Class: CodeFromBoolInstruction
Instance Attribute Summary
Attributes inherited from Instruction
#context
Instance Method Summary
collapse
Methods inherited from Instruction
all_instructions, #go, inherited, #initialize, #needs, #pushes, to_nudgecode
Constructor Details
This class inherits a constructor from Instruction
Instance Method Details
#cleanup ⇒ Object
13
14
15
|
# File 'lib/instructions/conversion/code_from_bool.rb', line 13
def cleanup
pushes :code, @result
end
|
#derive ⇒ Object
10
11
12
|
# File 'lib/instructions/conversion/code_from_bool.rb', line 10
def derive
@result = ValuePoint.new("code", "value «bool»\n«bool» #{@arg}")
end
|
#preconditions? ⇒ Boolean
4
5
6
|
# File 'lib/instructions/conversion/code_from_bool.rb', line 4
def preconditions?
needs :bool, 1
end
|
#setup ⇒ Object
7
8
9
|
# File 'lib/instructions/conversion/code_from_bool.rb', line 7
def setup
@arg = @context.pop_value(:bool)
end
|