Class: Nydp::AssignmentInstruction
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #execute(vm) ⇒ Object
-
#initialize(name) ⇒ AssignmentInstruction
constructor
A new instance of AssignmentInstruction.
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ AssignmentInstruction
Returns a new instance of AssignmentInstruction.
5 6 7 |
# File 'lib/nydp/assignment.rb', line 5 def initialize name @name = name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/nydp/assignment.rb', line 3 def name @name end |
Instance Method Details
#execute(vm) ⇒ Object
9 10 11 12 13 |
# File 'lib/nydp/assignment.rb', line 9 def execute vm @name.assign vm.peek_arg, vm.current_context rescue raise "assigning #{@name.inspect}" end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/nydp/assignment.rb', line 15 def to_s "#assign #{@name}" end |