Class: Cucumber::Tree::Step

Inherits:
BaseStep show all
Defined in:
lib/gems/cucumber-0.1.15/lib/cucumber/tree/step.rb

Direct Known Subclasses

RowStepOutline, StepOutline

Constant Summary

Constants inherited from BaseStep

BaseStep::PENDING_ADJUSTMENT, BaseStep::REGULAR_ADJUSTMENT

Instance Attribute Summary collapse

Attributes inherited from BaseStep

#error, #scenario

Instance Method Summary collapse

Methods inherited from BaseStep

#actual_keyword, #execute_in, #file, #forced_to_pending?, #format_error, #id, #length, new_id!, #outline?, #padding_length, #previous_step, #steps

Constructor Details

#initialize(scenario, keyword, name, line) ⇒ Step

Returns a new instance of Step.



111
112
113
114
115
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/tree/step.rb', line 111

def initialize(scenario, keyword, name, line)
  @scenario, @keyword, @name, @line = scenario, keyword, name, line
  @extra_args ||= []
  @arity = 0
end

Instance Attribute Details

#arityObject

Returns the value of attribute arity.



105
106
107
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/tree/step.rb', line 105

def arity
  @arity
end

#extra_argsObject

Returns the value of attribute extra_args.



105
106
107
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/tree/step.rb', line 105

def extra_args
  @extra_args
end

#keywordObject (readonly)

Returns the value of attribute keyword.



104
105
106
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/tree/step.rb', line 104

def keyword
  @keyword
end

#lineObject (readonly)

Returns the value of attribute line.



104
105
106
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/tree/step.rb', line 104

def line
  @line
end

#nameObject (readonly)

Returns the value of attribute name.



104
105
106
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/tree/step.rb', line 104

def name
  @name
end

Instance Method Details

#format(regexp, format = nil, &proc) ⇒ Object



123
124
125
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/tree/step.rb', line 123

def format(regexp, format=nil, &proc)
  regexp.nil? ? name : name.gzub(regexp, format, &proc)
end

#regexp_args_proc(step_mother) ⇒ Object



117
118
119
120
121
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/tree/step.rb', line 117

def regexp_args_proc(step_mother)
  regexp, args, proc = step_mother.regexp_args_proc(name)
  @arity = args.length
  [regexp, (args + extra_args), proc]
end

#row?Boolean

Returns:

  • (Boolean)


107
108
109
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/tree/step.rb', line 107

def row?
  false
end