class Cucumber::Core::Gherkin::AstBuilder::DocumentBuilder

Public Class Methods

new(file, attributes) click to toggle source
# File lib/cucumber/core/gherkin/ast_builder.rb, line 98
def initialize(file, attributes)
  @file = file
  @attributes = rubify_keys(attributes.dup)
end

Public Instance Methods

all_comments() click to toggle source
# File lib/cucumber/core/gherkin/ast_builder.rb, line 110
def all_comments
  attributes[:comments].map do |comment|
    Ast::Comment.new(
      Ast::Location.new(file, comment[:location][:line]),
      comment[:text]
    )
  end
end
feature() click to toggle source
# File lib/cucumber/core/gherkin/ast_builder.rb, line 103
def feature
  return Ast::NullFeature.new unless attributes[:feature]
  feature_builder = FeatureBuilder.new(file, attributes[:feature])
  feature_builder.handle_comments(all_comments)
  feature_builder.result
end