Parent

Gherkin::Parser::FormatterListener

Adapter from the “raw” Gherkin Listener API to the slightly more high-level Formatter API, which is easier to implement (less state to keep track of).

Public Class Methods

new(formatter) click to toggle source
# File lib/gherkin/parser/formatter_listener.rb, line 12
def initialize(formatter)
  @formatter = formatter
  @comments = []
  @tags = []
  @table = nil
end

Public Instance Methods

background(keyword, name, description, line) click to toggle source
# File lib/gherkin/parser/formatter_listener.rb, line 36
def background(keyword, name, description, line)
  @formatter.background(grab_comments!, keyword, name, description, line)
end
comment(content, line) click to toggle source
# File lib/gherkin/parser/formatter_listener.rb, line 24
def comment(content, line)
  @comments << content
end
eof() click to toggle source
# File lib/gherkin/parser/formatter_listener.rb, line 69
def eof
  replay_step_or_examples
  @formatter.eof
end
examples(keyword, name, description, line) click to toggle source
# File lib/gherkin/parser/formatter_listener.rb, line 50
def examples(keyword, name, description, line)
  replay_step_or_examples
  @examples = [grab_comments!, grab_tags!, keyword, name, description, line]
end
feature(keyword, name, description, line) click to toggle source
# File lib/gherkin/parser/formatter_listener.rb, line 32
def feature(keyword, name, description, line)
  @formatter.feature(grab_comments!, grab_tags!, keyword, name, description, @uri)
end
location(uri, offset) click to toggle source
# File lib/gherkin/parser/formatter_listener.rb, line 19
def location(uri, offset)
  @uri = uri
  @offset = offset
end
py_string(py_string, line) click to toggle source
# File lib/gherkin/parser/formatter_listener.rb, line 65
def py_string(py_string, line)
  @py_string = py_string
end
row(cells, line) click to toggle source
# File lib/gherkin/parser/formatter_listener.rb, line 60
def row(cells, line)
  @table ||= []
  @table << Row.new(cells, grab_comments!, line)
end
scenario(keyword, name, description, line) click to toggle source
# File lib/gherkin/parser/formatter_listener.rb, line 40
def scenario(keyword, name, description, line)
  replay_step_or_examples
  @formatter.scenario(grab_comments!, grab_tags!, keyword, name, description, line)
end
scenario_outline(keyword, name, description, line) click to toggle source
# File lib/gherkin/parser/formatter_listener.rb, line 45
def scenario_outline(keyword, name, description, line)
  replay_step_or_examples
  @formatter.scenario_outline(grab_comments!, grab_tags!, keyword, name, description, line)
end
step(keyword, name, line) click to toggle source
# File lib/gherkin/parser/formatter_listener.rb, line 55
def step(keyword, name, line)
  replay_step_or_examples
  @step = [grab_comments!, keyword, name, line]
end
tag(name, line) click to toggle source
# File lib/gherkin/parser/formatter_listener.rb, line 28
def tag(name, line)
  @tags << name
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.