Parent

Gherkin::Lexer::I18nLexer

The main entry point to lexing Gherkin source.

Attributes

i18n_language[R]

Public Class Methods

new(listener, force_ruby=false) click to toggle source
    # File lib/gherkin/lexer/i18n_lexer.rb, line 16
16:       def initialize(listener, force_ruby=false)
17:         @listener = listener
18:         @force_ruby = force_ruby
19:       end

Public Instance Methods

scan(source) click to toggle source
    # File lib/gherkin/lexer/i18n_lexer.rb, line 21
21:       def scan(source)
22:         create_delegate(source).scan(source)
23:       end

Private Instance Methods

create_delegate(source) click to toggle source
    # File lib/gherkin/lexer/i18n_lexer.rb, line 27
27:       def create_delegate(source)
28:         @i18n_language = lang(source)
29:         @i18n_language.lexer(@listener, @force_ruby)
30:       end
lang(source) click to toggle source
    # File lib/gherkin/lexer/i18n_lexer.rb, line 32
32:       def lang(source)
33:         line_one = source.split(/\n/)[0]
34:         match = LANGUAGE_PATTERN.match(line_one)
35:         I18n.get(match ? match[1] : 'en')
36:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.