Class: ActionDispatch::Journey::Scanner

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initializeScanner

Returns a new instance of Scanner.


8
9
10
# File 'actionpack/lib/action_dispatch/journey/scanner.rb', line 8

def initialize
  @ss = nil
end

Instance Method Details

#eos?Boolean

Returns:

  • (Boolean)

16
17
18
# File 'actionpack/lib/action_dispatch/journey/scanner.rb', line 16

def eos?
  @ss.eos?
end

#next_tokenObject


28
29
30
31
32
33
# File 'actionpack/lib/action_dispatch/journey/scanner.rb', line 28

def next_token
  return if @ss.eos?

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

#posObject


20
21
22
# File 'actionpack/lib/action_dispatch/journey/scanner.rb', line 20

def pos
  @ss.pos
end

#pre_matchObject


24
25
26
# File 'actionpack/lib/action_dispatch/journey/scanner.rb', line 24

def pre_match
  @ss.pre_match
end

#scan_setup(str) ⇒ Object


12
13
14
# File 'actionpack/lib/action_dispatch/journey/scanner.rb', line 12

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