Class: TDParser::TokenBuffer
- Inherits:
-
Array
- Object
- Array
- TDParser::TokenBuffer
- Defined in:
- lib/tdp.rb
Instance Attribute Summary collapse
-
#map ⇒ Object
Returns the value of attribute map.
Instance Method Summary collapse
- #[](idx) ⇒ Object
- #[]=(idx, val) ⇒ Object
- #clear ⇒ Object
-
#initialize(*args) ⇒ TokenBuffer
constructor
A new instance of TokenBuffer.
- #state ⇒ Object
- #state=(s) ⇒ Object
Constructor Details
#initialize(*args) ⇒ TokenBuffer
Returns a new instance of TokenBuffer.
39 40 41 42 |
# File 'lib/tdp.rb', line 39 def initialize(*args) super(*args) @map = {} end |
Instance Attribute Details
#map ⇒ Object
Returns the value of attribute map.
37 38 39 |
# File 'lib/tdp.rb', line 37 def map @map end |
Instance Method Details
#[](idx) ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/tdp.rb', line 44 def [](idx) case idx when Symbol, String @map[idx] else super(idx) end end |
#[]=(idx, val) ⇒ Object
53 54 55 56 57 58 59 60 |
# File 'lib/tdp.rb', line 53 def []=(idx, val) case idx when Symbol, String @map[idx] = val else super(idx, val) end end |
#clear ⇒ Object
70 71 72 73 |
# File 'lib/tdp.rb', line 70 def clear() super() @map.clear() end |
#state ⇒ Object
62 63 64 |
# File 'lib/tdp.rb', line 62 def state() @map[:__state__] end |
#state=(s) ⇒ Object
66 67 68 |
# File 'lib/tdp.rb', line 66 def state=(s) @map[:__state__] = s end |