Class: Cucumber::Wire::StepArgument

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/wire/step_argument.rb

Overview

Defines the location and value of a captured argument from the step text

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(offset, val) ⇒ StepArgument

Returns a new instance of StepArgument.



11
12
13
# File 'lib/cucumber/wire/step_argument.rb', line 11

def initialize(offset, val)
  @offset, @value = offset, val
end

Instance Attribute Details

#offsetObject (readonly)

Returns the value of attribute offset.



9
10
11
# File 'lib/cucumber/wire/step_argument.rb', line 9

def offset
  @offset
end

Instance Method Details

#groupObject



19
20
21
# File 'lib/cucumber/wire/step_argument.rb', line 19

def group
  CucumberExpressions::Group.new(@value, @offset, @offset + @value.length, [])
end

#value(_current_world) ⇒ Object



15
16
17
# File 'lib/cucumber/wire/step_argument.rb', line 15

def value(_current_world)
  @value
end