You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: step_match.rb
    path of file: ./repos/cucumber-ruby/lib/cucumber
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'cucumber/multiline_argument'

module Cucumber
  # Represents the match found between a Test Step and its activation
  class StepMatch # :nodoc:
    attr_reader :step_definition, :step_arguments

    def initialize(step_definition, step_name, step_arguments)
      raise "step_arguments can't be nil (but it can be an empty array)" if step_arguments.nil?

      @step_definition = step_definition
  
    
    def replace_arguments(string, step_arguments, format)
      s = string.dup
      offset = past_offset = 0
      step_arguments.each do |step_argument|
        group = step_argument.group
        next if group.value.nil? || group.start < past_offset

        replacement = if block_given?
                        yield(group.value)
                      elsif format.instance_of?(Proc)
                        format.call(group.value)
                      else
                        format % group.value
                      end

        s[group.start + offset, group.value.length] = replacement
        offset += replacement.unpack('U*').length - group.value.unpack('U*').length
        past_offset = group.start + group.value.length
      end