Class: ActionDispatch::Journey::Scanner
- Defined in:
- actionpack/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.
6 7 8 |
# File 'actionpack/lib/action_dispatch/journey/scanner.rb', line 6 def initialize @ss = nil end |
Instance Method Details
#eos? ⇒ Boolean
14 15 16 |
# File 'actionpack/lib/action_dispatch/journey/scanner.rb', line 14 def eos? @ss.eos? end |
#next_token ⇒ Object
26 27 28 29 30 31 |
# File 'actionpack/lib/action_dispatch/journey/scanner.rb', line 26 def next_token return if @ss.eos? until token = scan || @ss.eos?; end token end |
#pos ⇒ Object
18 19 20 |
# File 'actionpack/lib/action_dispatch/journey/scanner.rb', line 18 def pos @ss.pos end |
#pre_match ⇒ Object
22 23 24 |
# File 'actionpack/lib/action_dispatch/journey/scanner.rb', line 22 def pre_match @ss.pre_match end |
#scan_setup(str) ⇒ Object
10 11 12 |
# File 'actionpack/lib/action_dispatch/journey/scanner.rb', line 10 def scan_setup(str) @ss = StringScanner.new(str) end |