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.



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

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.



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

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



27
28
29
# File 'lib/cucumber/step_match.rb', line 27

def backtrace_line
  @step_definition.backtrace_line
end

#file_colon_lineObject



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

def file_colon_line
  @step_definition.file_colon_line
end

#format_args(format = lambda{|a| a}) ⇒ Object



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

def format_args(format = lambda{|a| a})
  @formatted_step_name || @step_definition.format_args(@step_name, format)
end

#invoke(world, multiline_arg) ⇒ Object



13
14
15
16
17
# File 'lib/cucumber/step_match.rb', line 13

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

#nameObject



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

def name
  @formatted_step_name
end

#text_lengthObject



31
32
33
# File 'lib/cucumber/step_match.rb', line 31

def text_length
  @step_definition.text_length
end