Parent

Class/Module Index [+]

Quicksearch

Gherkin::Listener::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/listener/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/listener/formatter_listener.rb, line 31
def background(keyword, name, description, line)
  @formatter.background(Formatter::Model::Background.new(grab_comments!, keyword, name, description, line))
end
comment(value, line) click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 19
def comment(value, line)
  @comments << Formatter::Model::Comment.new(value, line)
end
doc_string(string, line) click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 60
def doc_string(string, line)
  @doc_string = Formatter::Model::DocString.new(string, line)
end
eof() click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 64
def eof
  replay_step_or_examples
  @formatter.eof
end
examples(keyword, name, description, line) click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 45
def examples(keyword, name, description, line)
  replay_step_or_examples
  @examples_statement = Formatter::Model::Examples.new(grab_comments!, grab_tags!, keyword, name, description, line)
end
feature(keyword, name, description, line) click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 27
def feature(keyword, name, description, line)
  @formatter.feature(Formatter::Model::Feature.new(grab_comments!, grab_tags!, keyword, name, description, line))
end
row(cells, line) click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 55
def row(cells, line)
  @table ||= []
  @table << Formatter::Model::Row.new(grab_comments!, cells, line)
end
scenario(keyword, name, description, line) click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 35
def scenario(keyword, name, description, line)
  replay_step_or_examples
  @formatter.scenario(Formatter::Model::Scenario.new(grab_comments!, grab_tags!, keyword, name, description, line))
end
scenario_outline(keyword, name, description, line) click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 40
def scenario_outline(keyword, name, description, line)
  replay_step_or_examples
  @formatter.scenario_outline(Formatter::Model::ScenarioOutline.new(grab_comments!, grab_tags!, keyword, name, description, line))
end
step(keyword, name, line) click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 50
def step(keyword, name, line)
  replay_step_or_examples
  @step_statement = Formatter::Model::Step.new(grab_comments!, keyword, name, line)
end
syntax_error(state, ev, legal_events, uri, line) click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 69
def syntax_error(state, ev, legal_events, uri, line)
  @formatter.syntax_error(state, ev, legal_events, uri, line)
end
tag(name, line) click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 23
def tag(name, line)
  @tags << Formatter::Model::Tag.new(name, line)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.