class Gherkin::Listener::FormatterListener::Stash

Attributes

comments[R]
ids[R]
tags[R]

Public Class Methods

new() click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 93
def initialize
  @comments, @tags, @ids = [], [], []
  @row_index = 0
end

Public Instance Methods

basic_statement() { |comments, "| ... } click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 121
def basic_statement
  @row_index += 1
  yield @comments, "#{@examples_id};#{@row_index}"
  @comments = []
end
comment(comment) click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 98
def comment(comment)
  @comments << comment
end
examples(name) { |comments, tags, examples_id| ... } click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 114
def examples(name)
  @examples_id = "#{@feature_element_id};#{id(name)}"
  @row_index = 0
  yield @comments, @tags, @examples_id
  @comments, @tags = [], []
end
feature(name) { |comments, tags, feature_id| ... } click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 102
def feature(name)
  @feature_id = id(name)
  yield @comments, @tags, @feature_id
  @comments, @tags = [], []
end
feature_element(name) { |comments, tags, feature_element_id| ... } click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 108
def feature_element(name)
  @feature_element_id = "#{@feature_id};#{id(name)}"
  yield @comments, @tags, @feature_element_id
  @comments, @tags = [], []
end
id(name) click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 131
def id(name)
  (name || '').gsub(/[\s_]/, '-').downcase
end
tag(tag) click to toggle source
# File lib/gherkin/listener/formatter_listener.rb, line 127
def tag(tag)
  @tags << tag
end