Class: Cucumber::Core::Gherkin::AstBuilder::ExamplesTableBuilder

Inherits:
Builder
  • Object
show all
Defined in:
lib/cucumber/core/gherkin/ast_builder.rb

Defined Under Namespace

Classes: ExampleRowBuilder, HeaderBuilder

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Builder

#handle_comments

Constructor Details

#initializeExamplesTableBuilder

Returns a new instance of ExamplesTableBuilder.



293
294
295
296
297
298
299
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 293

def initialize(*)
  super
  @header_builder = HeaderBuilder.new(file, attributes[:table_header])
  @example_rows_builders = attributes[:table_body].map do |row_attributes|
    ExampleRowBuilder.new(file, row_attributes)
  end
end

Instance Attribute Details

#example_rows_buildersObject (readonly)

Returns the value of attribute example_rows_builders.



291
292
293
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 291

def example_rows_builders
  @example_rows_builders
end

#header_builderObject (readonly)

Returns the value of attribute header_builder.



291
292
293
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 291

def header_builder
  @header_builder
end

Instance Method Details

#result(language) ⇒ Object



301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 301

def result(language)
  Ast::Examples.new(
    location,
    comments,
    tags,
    keyword,
    name,
    description,
    header,
    example_rows(language)
  )
end