lib/bmg/operator/shared/unary.rb in bmg-0.16.7 vs lib/bmg/operator/shared/unary.rb in bmg-0.17.0
- old
+ new
@@ -1,16 +1,24 @@
module Bmg
module Operator
module Unary
include Operator
+ def bind(binding)
+ _with_operand(operand.bind(binding))
+ end
+
protected
- attr_reader :operand
+ attr_accessor :operand
def _visit(parent, visitor)
visitor.call(self, parent)
operand._visit(self, visitor)
+ end
+
+ def _with_operand(operand)
+ dup.tap{|d| d.operand = operand }
end
def operands
[operand]
end