Sha256: fff98bd25c920f3f6833162657c723e1b2e4d7c25dbc0194b0d4b8b0dc8624d4
Contents?: true
Size: 475 Bytes
Versions: 3
Compression:
Stored size: 475 Bytes
Contents
# pops the top 2 items of the +:bool+ stack; # pushes a ValuePoint with their logical AND onto the +:bool+ stack # # *needs:* 2 +:bool+ # # *pushes:* 1 +:bool+ # class BoolAndInstruction < Instruction def preconditions? needs :bool, 2 end def setup @arg1 = @context.pop_value(:bool) @arg2 = @context.pop_value(:bool) end def derive @result = ValuePoint.new("bool", @arg1 && @arg2) end def cleanup pushes :bool, @result end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
nudge-0.2.9 | lib/instructions/bool/bool_and.rb |
nudge-0.2.8 | lib/instructions/bool/bool_and.rb |
nudge-0.2.7 | lib/instructions/bool/bool_and.rb |