class Gherkin::TokenFormatterBuilder
Public Class Methods
Public Instance Methods
Source
# File lib/gherkin/token_formatter_builder.rb, line 11 def build(token) @tokens_text << "#{format_token(token)}\n" end
Source
# File lib/gherkin/token_formatter_builder.rb, line 18 def end_rule(rule_type) end
Source
# File lib/gherkin/token_formatter_builder.rb, line 21 def get_result @tokens_text end
Source
# File lib/gherkin/token_formatter_builder.rb, line 7 def reset @tokens_text = "" end
Source
# File lib/gherkin/token_formatter_builder.rb, line 15 def start_rule(rule_type) end
Private Instance Methods
Source
# File lib/gherkin/token_formatter_builder.rb, line 26 def format_token(token) return "EOF" if token.eof? sprintf "(%s:%s)%s:%s/%s/%s", token.location[:line], token.location[:column], token.matched_type, token.matched_keyword, token.matched_text, Array(token.matched_items).map { |i| "#{i.column}:#{i.text}"}.join(',') end