Class: Peruby::Op::PackageSwitch

Inherits:
Base
  • Object
show all
Defined in:
lib/peruby/op/control.rb

Overview

Changes the package used for unqualified global names.

Instance Method Summary collapse

Methods inherited from Base

#argument_cells, #local_slot, #lvalue, #run_subroutine, #to_callable, #warning_directive?

Constructor Details

#initialize(name) ⇒ PackageSwitch

Returns a new instance of PackageSwitch.



132
# File 'lib/peruby/op/control.rb', line 132

def initialize(name) = @name = name

Instance Method Details

#run(env, _context) ⇒ Object



133
# File 'lib/peruby/op/control.rb', line 133

def run(env, _context) = env.package = @name