Class: TestML::Function
- Inherits:
-
Object
- Object
- TestML::Function
- Defined in:
- lib/testml/runtime.rb
Overview
Constant Summary collapse
- @@outer =
{}
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#signature ⇒ Object
Returns the value of attribute signature.
-
#statements ⇒ Object
Returns the value of attribute statements.
Instance Method Summary collapse
- #forgetvar(name) ⇒ Object
- #getvar(name) ⇒ Object
-
#initialize ⇒ Function
constructor
A new instance of Function.
- #outer ⇒ Object
- #outer=(value) ⇒ Object
- #setvar(name, value) ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize ⇒ Function
Returns a new instance of Function.
268 269 270 |
# File 'lib/testml/runtime.rb', line 268 def initialize @statements = [] end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
260 261 262 |
# File 'lib/testml/runtime.rb', line 260 def data @data end |
#namespace ⇒ Object
Returns the value of attribute namespace.
259 260 261 |
# File 'lib/testml/runtime.rb', line 259 def namespace @namespace end |
#signature ⇒ Object
Returns the value of attribute signature.
257 258 259 |
# File 'lib/testml/runtime.rb', line 257 def signature @signature end |
#statements ⇒ Object
Returns the value of attribute statements.
258 259 260 |
# File 'lib/testml/runtime.rb', line 258 def statements @statements end |
Instance Method Details
#forgetvar(name) ⇒ Object
287 288 289 |
# File 'lib/testml/runtime.rb', line 287 def forgetvar name namespace.delete name end |
#getvar(name) ⇒ Object
272 273 274 275 276 277 278 279 280 281 |
# File 'lib/testml/runtime.rb', line 272 def getvar name s = self while s if s.namespace.key? name return s.namespace[name] end s = s.outer end nil end |
#outer ⇒ Object
263 |
# File 'lib/testml/runtime.rb', line 263 def outer; @@outer[self.object_id] end |
#outer=(value) ⇒ Object
264 |
# File 'lib/testml/runtime.rb', line 264 def outer=(value); @@outer[self.object_id] = value end |
#setvar(name, value) ⇒ Object
283 284 285 |
# File 'lib/testml/runtime.rb', line 283 def setvar name, value namespace[name] = value end |
#type ⇒ Object
265 |
# File 'lib/testml/runtime.rb', line 265 def type; 'Func' end |