Class: GherkinRuby::AST::Scenario

Inherits:
Node
  • Object
show all
Includes:
Enumerable
Defined in:
lib/gherkin_ruby/ast.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#filename

Instance Method Summary collapse

Methods inherited from Node

#accept, #pos

Constructor Details

#initialize(name, steps = [], tags = []) ⇒ Scenario

Returns a new instance of Scenario.



59
60
61
62
63
# File 'lib/gherkin_ruby/ast.rb', line 59

def initialize(name, steps=[], tags=[])
  @name  = name.to_s
  @steps = steps
  @tags  = tags
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



55
56
57
# File 'lib/gherkin_ruby/ast.rb', line 55

def name
  @name
end

#stepsObject (readonly)

Returns the value of attribute steps.



55
56
57
# File 'lib/gherkin_ruby/ast.rb', line 55

def steps
  @steps
end

#tagsObject (readonly)

Returns the value of attribute tags.



55
56
57
# File 'lib/gherkin_ruby/ast.rb', line 55

def tags
  @tags
end

Instance Method Details

#eachObject



69
70
71
# File 'lib/gherkin_ruby/ast.rb', line 69

def each
  @steps.each
end

#lineObject



65
66
67
# File 'lib/gherkin_ruby/ast.rb', line 65

def line
  @steps.first.line - 1 if @steps.any?
end