Class: TDParser::TokenBuffer

Inherits:
Array
  • Object
show all
Defined in:
lib/tdp.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#mapObject

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

#clearObject



70
71
72
73
# File 'lib/tdp.rb', line 70

def clear()
  super()
  @map.clear()
end

#stateObject



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