Class: Cucumber::Core::Gherkin::AstBuilder::BackgroundBuilder
- Defined in:
- lib/cucumber/core/gherkin/ast_builder.rb
Instance Attribute Summary collapse
-
#step_builders ⇒ Object
readonly
Returns the value of attribute step_builders.
Instance Method Summary collapse
- #children ⇒ Object
-
#initialize ⇒ BackgroundBuilder
constructor
A new instance of BackgroundBuilder.
- #result(language) ⇒ Object
- #steps(language) ⇒ Object
Methods inherited from Builder
Constructor Details
#initialize ⇒ BackgroundBuilder
Returns a new instance of BackgroundBuilder.
152 153 154 155 |
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 152 def initialize(*) super @step_builders = attributes[:steps].map { |step| StepBuilder.new(file, step) } end |
Instance Attribute Details
#step_builders ⇒ Object (readonly)
Returns the value of attribute step_builders.
150 151 152 |
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 150 def step_builders @step_builders end |
Instance Method Details
#children ⇒ Object
172 173 174 |
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 172 def children step_builders end |
#result(language) ⇒ Object
157 158 159 160 161 162 163 164 165 166 |
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 157 def result(language) Ast::Background.new( location, comments, keyword, name, description, steps(language) ) end |
#steps(language) ⇒ Object
168 169 170 |
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 168 def steps(language) step_builders.map { |builder| builder.result(language) } end |