Sha256: 92c7a7c8af305c3c99e0ee8ce87c78c03b7d22b61b95565a759df3b1c25f7e6a

Contents?: true

Size: 631 Bytes

Versions: 43

Compression:

Stored size: 631 Bytes

Contents

module Bmg
  module Operator
    module Binary
      include Operator

      def bind(binding)
        _with_operands(left.bind(binding), right.bind(binding))
      end

    protected

      attr_accessor :left, :right

      def _visit(parent, visitor)
        visitor.call(self, parent)
        left.send(:_visit, self, visitor)
        right.send(:_visit, self, visitor)
      end

      def _with_operands(left, right)
        dup.tap{|d|
          d.left = left
          d.right = right
        }
      end

      def operands
        [left, right]
      end

    end # module Binary
  end # module Operator
end # module Bmg

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
bmg-0.23.3 lib/bmg/operator/shared/binary.rb
bmg-0.23.2 lib/bmg/operator/shared/binary.rb
bmg-0.23.1 lib/bmg/operator/shared/binary.rb
bmg-0.23.0 lib/bmg/operator/shared/binary.rb
bmg-0.21.5 lib/bmg/operator/shared/binary.rb
bmg-0.21.4 lib/bmg/operator/shared/binary.rb
bmg-0.20.5 lib/bmg/operator/shared/binary.rb
bmg-0.19.3 lib/bmg/operator/shared/binary.rb
bmg-0.21.3 lib/bmg/operator/shared/binary.rb
bmg-0.21.2 lib/bmg/operator/shared/binary.rb
bmg-0.21.0 lib/bmg/operator/shared/binary.rb
bmg-0.20.4 lib/bmg/operator/shared/binary.rb
bmg-0.20.2 lib/bmg/operator/shared/binary.rb
bmg-0.20.1 lib/bmg/operator/shared/binary.rb
bmg-0.20.0 lib/bmg/operator/shared/binary.rb
bmg-0.19.2 lib/bmg/operator/shared/binary.rb
bmg-0.19.1 lib/bmg/operator/shared/binary.rb
bmg-0.19.0 lib/bmg/operator/shared/binary.rb
bmg-0.18.15 lib/bmg/operator/shared/binary.rb
bmg-0.18.14 lib/bmg/operator/shared/binary.rb