Class: Lucid::Parser::TDLBuilder::FeatureBuilder

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



149
150
151
# File 'lib/lucid/tdl_builder.rb', line 149

def add_child(child)
  children << child
end

#background_builder=(builder) ⇒ Object



145
146
147
# File 'lib/lucid/tdl_builder.rb', line 145

def background_builder=(builder)
  @background_builder = builder
end

#childrenObject



153
154
155
# File 'lib/lucid/tdl_builder.rb', line 153

def children
  @children ||= []
end

#result(language) ⇒ Object



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/lucid/tdl_builder.rb', line 128

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