Class: Cucumber::Core::Gherkin::AstBuilder::ScenarioBuilder

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

#initializeScenarioBuilder

Returns a new instance of ScenarioBuilder.



180
181
182
183
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 180

def initialize(*)
  super
  @step_builders = attributes[:steps].map { |step| StepBuilder.new(file, step) }
end

Instance Attribute Details

#step_buildersObject (readonly)

Returns the value of attribute step_builders.



178
179
180
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 178

def step_builders
  @step_builders
end

Instance Method Details

#childrenObject



201
202
203
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 201

def children
  step_builders
end

#result(language) ⇒ Object



185
186
187
188
189
190
191
192
193
194
195
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 185

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

#steps(language) ⇒ Object



197
198
199
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 197

def steps(language)
  step_builders.map { |builder| builder.result(language) }
end