Class: Cucumber::Core::Gherkin::AstBuilder::ScenarioOutlineBuilder
- Inherits:
-
Builder
- Object
- Builder
- Cucumber::Core::Gherkin::AstBuilder::ScenarioOutlineBuilder
- Defined in:
- lib/cucumber/core/gherkin/ast_builder.rb
Instance Attribute Summary collapse
-
#example_builders ⇒ Object
readonly
Returns the value of attribute example_builders.
-
#step_builders ⇒ Object
readonly
Returns the value of attribute step_builders.
Instance Method Summary collapse
- #children ⇒ Object
- #examples(language) ⇒ Object
-
#initialize ⇒ ScenarioOutlineBuilder
constructor
A new instance of ScenarioOutlineBuilder.
- #result(language) ⇒ Object
- #steps(language) ⇒ Object
Methods inherited from Builder
Constructor Details
#initialize ⇒ ScenarioOutlineBuilder
Returns a new instance of ScenarioOutlineBuilder.
258 259 260 261 262 |
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 258 def initialize(*) super @step_builders = attributes[:steps].map { |step| OutlineStepBuilder.new(file, step) } @example_builders = attributes[:examples].map { |example| ExamplesTableBuilder.new(file, example) } end |
Instance Attribute Details
#example_builders ⇒ Object (readonly)
Returns the value of attribute example_builders.
256 257 258 |
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 256 def example_builders @example_builders end |
#step_builders ⇒ Object (readonly)
Returns the value of attribute step_builders.
256 257 258 |
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 256 def step_builders @step_builders end |
Instance Method Details
#children ⇒ Object
285 286 287 |
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 285 def children step_builders + example_builders end |
#examples(language) ⇒ Object
281 282 283 |
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 281 def examples(language) example_builders.map { |builder| builder.result(language) } end |
#result(language) ⇒ Object
264 265 266 267 268 269 270 271 272 273 274 275 |
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 264 def result(language) Ast::ScenarioOutline.new( location, comments, , keyword, name, description, steps(language), examples(language) ) end |
#steps(language) ⇒ Object
277 278 279 |
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 277 def steps(language) step_builders.map { |builder| builder.result(language) } end |