Class: Peruby::Op::AnonSub
Overview
Anonymous closure creation.
Instance Method Summary collapse
-
#initialize(prototype, body) ⇒ AnonSub
constructor
A new instance of AnonSub.
- #run(env, context) ⇒ Object
- #to_callable ⇒ Object
Methods inherited from Base
#argument_cells, #local_slot, #lvalue, #run_subroutine, #warning_directive?
Constructor Details
#initialize(prototype, body) ⇒ AnonSub
Returns a new instance of AnonSub.
50 51 52 53 |
# File 'lib/peruby/op/call.rb', line 50 def initialize(prototype, body) @prototype = prototype @body = body end |
Instance Method Details
#run(env, context) ⇒ Object
55 56 57 |
# File 'lib/peruby/op/call.rb', line 55 def run(env, context) reference(env, context, @body) end |