Class: Cucumber::Core::Gherkin::AstBuilder::FeatureBuilder

Inherits:
Builder
  • Object
show all
Defined in:
lib/cucumber/core/gherkin/ast_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFeatureBuilder

Returns a new instance of FeatureBuilder.



114
115
116
117
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 114

def initialize(*)
  super
  @background_builder = nil
end

Instance Attribute Details

#background_builder=(value) ⇒ Object

Sets the attribute background_builder

Parameters:

  • value

    the value to set the attribute background_builder to.



111
112
113
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 111

def background_builder=(value)
  @background_builder = value
end

Instance Method Details

#add_child(child) ⇒ Object



135
136
137
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 135

def add_child(child)
  children << child
end

#childrenObject



139
140
141
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 139

def children
  @children ||= []
end

#result(language) ⇒ Object



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 119

def result(language)
  background = background(language)
  Ast::Feature.new(
    node,
    language,
    location,
    background,
    comments,
    tags,
    node.keyword,
    node.name.lstrip,
    node.description.rstrip,
    children.map { |builder| builder.result(background, language, tags) }
  )
end