Class: Cucumber::StepMatch

Inherits:
Object show all
Defined in:
lib/cucumber/step_match.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(step_definition, step_name, formatted_step_name, args) ⇒ StepMatch

Returns a new instance of StepMatch.



6
7
8
# File 'lib/cucumber/step_match.rb', line 6

def initialize(step_definition, step_name, formatted_step_name, args)
  @step_definition, @step_name, @formatted_step_name, @args = step_definition, step_name, formatted_step_name, args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



4
5
6
# File 'lib/cucumber/step_match.rb', line 4

def args
  @args
end

#step_definitionObject (readonly)

Returns the value of attribute step_definition.



3
4
5
# File 'lib/cucumber/step_match.rb', line 3

def step_definition
  @step_definition
end

Instance Method Details

#backtrace_lineObject



24
25
26
# File 'lib/cucumber/step_match.rb', line 24

def backtrace_line
  @step_definition.backtrace_line
end

#file_colon_lineObject



20
21
22
# File 'lib/cucumber/step_match.rb', line 20

def file_colon_line
  @step_definition.file_colon_line
end

#format_args(format) ⇒ Object



16
17
18
# File 'lib/cucumber/step_match.rb', line 16

def format_args(format)
  @formatted_step_name || @step_definition.format_args(@step_name, format)
end

#invoke(world, multiline_arg) ⇒ Object



10
11
12
13
14
# File 'lib/cucumber/step_match.rb', line 10

def invoke(world, multiline_arg)
  all_args = @args.dup
  all_args << multiline_arg if multiline_arg
  @step_definition.invoke(world, all_args, @step_name)
end