Class: Gherkin::AST::Feature

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

Instance Attribute Summary collapse

Attributes inherited from Node

#column, #line

Instance Method Summary collapse

Methods inherited from Node

#accept

Constructor Details

#initialize(name, scenarios = [], background = nil) ⇒ Feature

Returns a new instance of Feature.



17
18
19
20
21
22
23
# File 'lib/gherkin/ast.rb', line 17

def initialize(name, scenarios=[], background=nil)
  @line, @column = name.line_and_column

  @name      = name.to_s
  @background = background
  @scenarios = scenarios
end

Instance Attribute Details

#backgroundObject (readonly)

Returns the value of attribute background.



13
14
15
# File 'lib/gherkin/ast.rb', line 13

def background
  @background
end

#nameObject (readonly)

Returns the value of attribute name.



13
14
15
# File 'lib/gherkin/ast.rb', line 13

def name
  @name
end

#scenariosObject (readonly)

Returns the value of attribute scenarios.



13
14
15
# File 'lib/gherkin/ast.rb', line 13

def scenarios
  @scenarios
end

Instance Method Details

#eachObject



25
26
27
# File 'lib/gherkin/ast.rb', line 25

def each
  @scenarios.each
end