Parent

Methods

Gherkin::JSONLexer

Public Class Methods

new(listener) click to toggle source
# File lib/gherkin/json_lexer.rb, line 6
def initialize(listener)
  @listener = listener
end

Public Instance Methods

scan(src, uri='unknown.json', offset=0) click to toggle source
# File lib/gherkin/json_lexer.rb, line 10
def scan(src, uri='unknown.json', offset=0)
  feature = JSON.parse(src)

  comments_for(feature)
  tags_for(feature)
  multiline_event(:feature, feature)

  if feature["background"]
    comments_for(feature["background"])
    multiline_event(:background, feature["background"])
    steps_for(feature["background"])
  end

  feature["elements"].each do |feature_element|
    parse_element(feature_element) 
  end if feature["elements"]

  @listener.eof
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.