Class: GherkinRuby::AST::Background

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(steps = []) ⇒ Background

Returns a new instance of Background.



41
42
43
# File 'lib/gherkin_ruby/ast.rb', line 41

def initialize(steps=[])
  @steps = steps
end

Instance Attribute Details

#stepsObject

Returns the value of attribute steps.



36
37
38
# File 'lib/gherkin_ruby/ast.rb', line 36

def steps
  @steps
end

Instance Method Details

#eachObject



49
50
51
# File 'lib/gherkin_ruby/ast.rb', line 49

def each
  @steps.each
end

#lineObject



45
46
47
# File 'lib/gherkin_ruby/ast.rb', line 45

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