Class: Cucumber::Tree::Step
- Defined in:
- lib/gems/cucumber-0.1.15/lib/cucumber/tree/step.rb
Direct Known Subclasses
Constant Summary
Constants inherited from BaseStep
BaseStep::PENDING_ADJUSTMENT, BaseStep::REGULAR_ADJUSTMENT
Instance Attribute Summary collapse
-
#arity ⇒ Object
Returns the value of attribute arity.
-
#extra_args ⇒ Object
Returns the value of attribute extra_args.
-
#keyword ⇒ Object
readonly
Returns the value of attribute keyword.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from BaseStep
Instance Method Summary collapse
- #format(regexp, format = nil, &proc) ⇒ Object
-
#initialize(scenario, keyword, name, line) ⇒ Step
constructor
A new instance of Step.
- #regexp_args_proc(step_mother) ⇒ Object
- #row? ⇒ Boolean
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
#arity ⇒ Object
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_args ⇒ Object
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 |
#keyword ⇒ Object (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 |
#line ⇒ Object (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 |
#name ⇒ Object (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
107 108 109 |
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/tree/step.rb', line 107 def row? false end |