Class: Nydp::Closure
- Inherits:
-
Object
- Object
- Nydp::Closure
- Defined in:
- lib/nydp/closure.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#ifn ⇒ Object
Returns the value of attribute ifn.
Instance Method Summary collapse
-
#initialize(ifn, context) ⇒ Closure
constructor
A new instance of Closure.
- #invoke(vm, arg_values) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(ifn, context) ⇒ Closure
Returns a new instance of Closure.
5 6 7 |
# File 'lib/nydp/closure.rb', line 5 def initialize ifn, context @ifn, @context = ifn, context end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
3 4 5 |
# File 'lib/nydp/closure.rb', line 3 def context @context end |
#ifn ⇒ Object
Returns the value of attribute ifn.
3 4 5 |
# File 'lib/nydp/closure.rb', line 3 def ifn @ifn end |
Instance Method Details
#invoke(vm, arg_values) ⇒ Object
9 10 11 |
# File 'lib/nydp/closure.rb', line 9 def invoke vm, arg_values ifn.invoke vm, context, arg_values end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/nydp/closure.rb', line 13 def to_s "(closure #{context.inspect} : #{ifn.to_s})" end |