Class: ANTLR3::DOT::Context
- Inherits:
-
Object
- Object
- ANTLR3::DOT::Context
- Defined in:
- lib/antlr3/dot.rb
Instance Method Summary collapse
- #[](var) ⇒ Object
- #[]=(var, value) ⇒ Object
-
#initialize(template, vars = {}) ⇒ Context
constructor
A new instance of Context.
- #to_s ⇒ Object
Constructor Details
#initialize(template, vars = {}) ⇒ Context
Returns a new instance of Context.
59 60 61 62 63 64 |
# File 'lib/antlr3/dot.rb', line 59 def initialize( template, vars = {} ) @__template__ = template vars.each do |var, value| self[ var ] = value end end |
Instance Method Details
#[](var) ⇒ Object
55 56 57 |
# File 'lib/antlr3/dot.rb', line 55 def []( var ) instance_variable_get( :"@#{ var }" ) end |
#[]=(var, value) ⇒ Object
52 53 54 |
# File 'lib/antlr3/dot.rb', line 52 def []=( var, value ) instance_variable_set( :"@#{ var }", value ) end |
#to_s ⇒ Object
66 67 68 |
# File 'lib/antlr3/dot.rb', line 66 def to_s @__template__.result( binding ) end |