Class: ActionDispatch::Journey::Scanner

Inherits:
Object
  • Object
show all
Defined in:
lib/action_dispatch/journey/scanner.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initializeScanner

Returns a new instance of Scanner.



10
11
12
# File 'lib/action_dispatch/journey/scanner.rb', line 10

def initialize
  @ss = nil
end

Instance Method Details

#eos?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/action_dispatch/journey/scanner.rb', line 18

def eos?
  @ss.eos?
end

#next_tokenObject



30
31
32
33
34
35
# File 'lib/action_dispatch/journey/scanner.rb', line 30

def next_token
  return if @ss.eos?

  until token = scan || @ss.eos?; end
  token
end

#posObject



22
23
24
# File 'lib/action_dispatch/journey/scanner.rb', line 22

def pos
  @ss.pos
end

#pre_matchObject



26
27
28
# File 'lib/action_dispatch/journey/scanner.rb', line 26

def pre_match
  @ss.pre_match
end

#scan_setup(str) ⇒ Object



14
15
16
# File 'lib/action_dispatch/journey/scanner.rb', line 14

def scan_setup(str)
  @ss = StringScanner.new(str)
end