Class: Peruby::Op::SubDef
Overview
Runtime subroutine definition.
Instance Method Summary collapse
-
#initialize(name, prototype, body) ⇒ SubDef
constructor
A new instance of SubDef.
- #run(env, _context) ⇒ Object
- #to_callable ⇒ Object
Methods inherited from Base
#argument_cells, #local_slot, #lvalue, #run_subroutine, #warning_directive?
Constructor Details
#initialize(name, prototype, body) ⇒ SubDef
Returns a new instance of SubDef.
7 8 9 10 11 |
# File 'lib/peruby/op/call.rb', line 7 def initialize(name, prototype, body) @name = name @prototype = prototype @body = body end |
Instance Method Details
#run(env, _context) ⇒ Object
13 14 15 |
# File 'lib/peruby/op/call.rb', line 13 def run(env, _context) install(env, @body) end |