class Lucid::Parser::SpecBuilder::FeatureBuilder

Public Instance Methods

add_child(child) click to toggle source
# File lib/lucid/spec_builder.rb, line 153
def add_child(child)
  children << child
end
background_builder=(builder) click to toggle source
# File lib/lucid/spec_builder.rb, line 149
def background_builder=(builder)
  @background_builder = builder
end
children() click to toggle source
# File lib/lucid/spec_builder.rb, line 157
def children
  @children ||= []
end
result(language) click to toggle source
# File lib/lucid/spec_builder.rb, line 132
def result(language)
  background = background(language)
  feature = Lucid::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

Private Instance Methods

background(language) click to toggle source
# File lib/lucid/spec_builder.rb, line 163
def background(language)
  return Lucid::AST::EmptyBackground.new unless @background_builder
  @background ||= @background_builder.result(language)
end