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

Methods inherited from Builder

#handle_comments

Constructor Details

#initializeFeatureBuilder

Returns a new instance of FeatureBuilder.



123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 123

def initialize(*)
  super
  @language = Ast::LanguageDelegator.new(attributes[:language], ::Gherkin::Dialect.for(attributes[:language]))
  @feature_element_builders = attributes[:children].map do |child|
    case child[:type]
    when :Background
      BackgroundBuilder.new(file, child)
    when :Scenario
      ScenarioBuilder.new(file, child)
    else 
      ScenarioOutlineBuilder.new(file, child)
    end
  end
end

Instance Attribute Details

#feature_element_buildersObject (readonly)

Returns the value of attribute feature_element_builders.



121
122
123
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 121

def feature_element_builders
  @feature_element_builders
end

#languageObject (readonly)

Returns the value of attribute language.



121
122
123
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 121

def language
  @language
end

Instance Method Details

#resultObject



138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 138

def result
  Ast::Feature.new(
    language,
    location,
    comments,
    tags,
    keyword,
    name,
    description,
    feature_elements
  )
end