Class: Gherkin::Query

Inherits:
Object show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin/query.rb

Instance Method Summary collapse

Constructor Details

#initializeQuery

Returns a new instance of Query.



3
4
5
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin/query.rb', line 3

def initialize
  @ast_node_locations = {}
end

Instance Method Details

#location(ast_node_id) ⇒ Object



11
12
13
14
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin/query.rb', line 11

def location(ast_node_id)
  return @ast_node_locations[ast_node_id] if @ast_node_locations.has_key?(ast_node_id)
  raise AstNodeNotLocatedException, "No location found for #{ast_node_id} }. Known: #{@ast_node_locations.keys}"
end

#update(message) ⇒ Object



7
8
9
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin/query.rb', line 7

def update(message)
  update_feature(message.gherkin_document.feature) if message.gherkin_document
end