Parent

Methods

Gherkin::Formatter::Argument

Attributes

byte_offset[R]
val[R]

Public Class Methods

format(string, argument_format, arguments) click to toggle source
# File lib/gherkin/formatter/argument.rb, line 13
def self.format(string, argument_format, arguments)
  s = string.dup
  offset = past_offset = 0
  arguments.each do |arg|
    next if arg.byte_offset.nil? || arg.byte_offset < past_offset
    replacement = argument_format.format_argument(arg.val)
    s[arg.byte_offset + offset, arg.val.length] = replacement
    offset += replacement.unpack("U*").length - arg.val.unpack("U*").length
    past_offset = arg.byte_offset + arg.val.length
  end
  s
end
new(byte_offset, val) click to toggle source
# File lib/gherkin/formatter/argument.rb, line 9
def initialize(byte_offset, val)
  @byte_offset, @val = byte_offset, val
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.