Class: CSV::Parser::Scanner
- Inherits:
-
StringScanner
- Object
- StringScanner
- CSV::Parser::Scanner
- Defined in:
- lib/csv/parser.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ Scanner
constructor
A new instance of Scanner.
- #keep_back ⇒ Object
- #keep_drop ⇒ Object
- #keep_end ⇒ Object
- #keep_start ⇒ Object
Constructor Details
#initialize(*args) ⇒ Scanner
Returns a new instance of Scanner.
19 20 21 22 |
# File 'lib/csv/parser.rb', line 19 def initialize(*args) super @keeps = [] end |
Instance Method Details
#keep_back ⇒ Object
33 34 35 |
# File 'lib/csv/parser.rb', line 33 def keep_back self.pos = @keeps.pop end |
#keep_drop ⇒ Object
37 38 39 |
# File 'lib/csv/parser.rb', line 37 def keep_drop @keeps.pop end |
#keep_end ⇒ Object
28 29 30 31 |
# File 'lib/csv/parser.rb', line 28 def keep_end start = @keeps.pop string[start, pos - start] end |
#keep_start ⇒ Object
24 25 26 |
# File 'lib/csv/parser.rb', line 24 def keep_start @keeps.push(pos) end |