Class: Lucid::Parser::TDLBuilder::BackgroundBuilder

Inherits:
Builder show all
Defined in:
lib/lucid/tdl_builder.rb

Instance Method Summary collapse

Methods inherited from Builder

#initialize

Constructor Details

This class inherits a constructor from Lucid::Parser::TDLBuilder::Builder

Instance Method Details

#add_child(child) ⇒ Object



184
185
186
# File 'lib/lucid/tdl_builder.rb', line 184

def add_child(child)
  children << child
end

#childrenObject



188
189
190
# File 'lib/lucid/tdl_builder.rb', line 188

def children
  @children ||= []
end

#result(language) ⇒ Object



166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/lucid/tdl_builder.rb', line 166

def result(language)
  background = AST::Background.new(
    language,
    location,
    comment,
    node.keyword,
    node.name,
    node.description,
    steps(language)
  )
  background.gherkin_statement(node)
  background
end

#steps(language) ⇒ Object



180
181
182
# File 'lib/lucid/tdl_builder.rb', line 180

def steps(language)
  children.map { |child| child.result(language) }
end