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, NullHeaderBuilder

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Builder

#handle_comments

Constructor Details

#initializeExamplesTableBuilder

Returns a new instance of ExamplesTableBuilder.



307
308
309
310
311
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 307

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

Instance Attribute Details

#example_rows_buildersObject (readonly)

Returns the value of attribute example_rows_builders.



305
306
307
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 305

def example_rows_builders
  @example_rows_builders
end

#header_builderObject (readonly)

Returns the value of attribute header_builder.



305
306
307
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 305

def header_builder
  @header_builder
end

Instance Method Details

#result(language) ⇒ Object



313
314
315
316
317
318
319
320
321
322
323
324
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 313

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