Class: ActionDispatch::Journey::Scanner
- Inherits:
-
Object
- Object
- ActionDispatch::Journey::Scanner
- Defined in:
- lib/action_dispatch/journey/scanner.rb
Overview
:nodoc:
Instance Method Summary collapse
- #eos? ⇒ Boolean
-
#initialize ⇒ Scanner
constructor
A new instance of Scanner.
- #next_token ⇒ Object
- #pos ⇒ Object
- #pre_match ⇒ Object
- #scan_setup(str) ⇒ Object
Constructor Details
#initialize ⇒ Scanner
Returns a new instance of Scanner.
7 8 9 |
# File 'lib/action_dispatch/journey/scanner.rb', line 7 def initialize @ss = nil end |
Instance Method Details
#eos? ⇒ Boolean
15 16 17 |
# File 'lib/action_dispatch/journey/scanner.rb', line 15 def eos? @ss.eos? end |
#next_token ⇒ Object
27 28 29 30 31 32 |
# File 'lib/action_dispatch/journey/scanner.rb', line 27 def next_token return if @ss.eos? until token = scan || @ss.eos?; end token end |
#pos ⇒ Object
19 20 21 |
# File 'lib/action_dispatch/journey/scanner.rb', line 19 def pos @ss.pos end |
#pre_match ⇒ Object
23 24 25 |
# File 'lib/action_dispatch/journey/scanner.rb', line 23 def pre_match @ss.pre_match end |
#scan_setup(str) ⇒ Object
11 12 13 |
# File 'lib/action_dispatch/journey/scanner.rb', line 11 def scan_setup(str) @ss = StringScanner.new(str) end |