Class: Cucumberator::CurrentStep
- Inherits:
-
Object
- Object
- Cucumberator::CurrentStep
- Defined in:
- lib/cucumberator/current_step.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#line ⇒ Object
Returns the value of attribute line.
-
#offset ⇒ Object
Returns the value of attribute offset.
Instance Method Summary collapse
- #current_sexp ⇒ Object
- #increase ⇒ Object
-
#initialize(environment) ⇒ CurrentStep
constructor
A new instance of CurrentStep.
- #scenario_sexp ⇒ Object
- #set_line ⇒ Object
Constructor Details
#initialize(environment) ⇒ CurrentStep
Returns a new instance of CurrentStep.
8 9 10 11 12 |
# File 'lib/cucumberator/current_step.rb', line 8 def initialize(environment) @environment = environment @offset = 0 set_line end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
6 7 8 |
# File 'lib/cucumberator/current_step.rb', line 6 def environment @environment end |
#line ⇒ Object
Returns the value of attribute line.
5 6 7 |
# File 'lib/cucumberator/current_step.rb', line 5 def line @line end |
#offset ⇒ Object
Returns the value of attribute offset.
5 6 7 |
# File 'lib/cucumberator/current_step.rb', line 5 def offset @offset end |
Instance Method Details
#current_sexp ⇒ Object
23 24 25 |
# File 'lib/cucumberator/current_step.rb', line 23 def current_sexp scenario_sexp[offset] end |
#increase ⇒ Object
18 19 20 21 |
# File 'lib/cucumberator/current_step.rb', line 18 def increase self.offset += 1 set_line end |
#scenario_sexp ⇒ Object
14 15 16 |
# File 'lib/cucumberator/current_step.rb', line 14 def scenario_sexp @scenario_sexp ||= environment.to_sexp.select { |identificator, _| identificator == :step_invocation } end |
#set_line ⇒ Object
27 28 29 |
# File 'lib/cucumberator/current_step.rb', line 27 def set_line self.line = Cucumberator::StepLine.new(current_sexp[1]) if current_sexp end |