Module: Cucumber::Core::Gherkin::Writer::HasElements

Includes:
AcceptsComments
Included in:
Background, Feature, Rule, Scenario, ScenarioOutline, Step
Defined in:
lib/cucumber/core/gherkin/writer/has_elements.rb

Defined Under Namespace

Modules: HasElementBuilders

Class Method Summary collapse

Instance Method Summary collapse

Methods included from AcceptsComments

#comment, #comment_lines, #slurp_comments

Class Method Details

.included(base) ⇒ Object



10
11
12
# File 'lib/cucumber/core/gherkin/writer/has_elements.rb', line 10

def self.included(base)
  base.extend HasElementBuilders
end

Instance Method Details

#build(source = []) ⇒ Object



14
15
16
# File 'lib/cucumber/core/gherkin/writer/has_elements.rb', line 14

def build(source = [])
  elements.inject(source + statements) { |acc, el| el.build(acc) }
end