Class: Cucumber::Core::Gherkin::AstBuilder::DocStringBuilder

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

Instance Method Summary collapse

Methods inherited from Builder

#handle_comments, #initialize

Constructor Details

This class inherits a constructor from Cucumber::Core::Gherkin::AstBuilder::Builder

Instance Method Details

#doc_string_locationObject



393
394
395
396
397
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 393

def doc_string_location
  start_line = attributes[:location][:line]
  end_line = start_line + attributes[:content].each_line.to_a.length + 1
  Ast::Location.new(file, start_line..end_line)
end

#resultObject



385
386
387
388
389
390
391
# File 'lib/cucumber/core/gherkin/ast_builder.rb', line 385

def result
  Ast::DocString.new(
    attributes[:content],
    attributes[:content_type],
    doc_string_location
  )
end