Class: Cucumber::Core::Gherkin::Parser

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

Instance Method Summary collapse

Constructor Details

#initialize(receiver, event_bus, gherkin_query) ⇒ Parser

Returns a new instance of Parser.



14
15
16
17
18
# File 'lib/cucumber/core/gherkin/parser.rb', line 14

def initialize(receiver, event_bus, gherkin_query)
  @receiver = receiver
  @event_bus = event_bus
  @gherkin_query = gherkin_query
end

Instance Method Details

#document(document) ⇒ Object



20
21
22
23
24
# File 'lib/cucumber/core/gherkin/parser.rb', line 20

def document(document)
  source_messages(document).each do |message|
    process(message, document)
  end
end

#doneObject



35
36
37
38
# File 'lib/cucumber/core/gherkin/parser.rb', line 35

def done
  receiver.done
  self
end

#gherkin_options(document) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/cucumber/core/gherkin/parser.rb', line 26

def gherkin_options(document)
  {
    default_dialect: document.language,
    include_source: false,
    include_gherkin_document: true,
    include_pickles: true
  }
end