Sha256: 8ae05d9324caa1d9a13ac24e63cd33a53b0867ba94cfdf7539b1bde2e7f0a6bb

Contents?: true

Size: 511 Bytes

Versions: 43

Compression:

Stored size: 511 Bytes

Contents

module Bmg
  module Operator
    module Unary
      include Operator

      def bind(binding)
        _with_operand(operand.bind(binding))
      end

    protected

      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

    end # module Unary
  end # module Operator
end # module Bmg

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
bmg-0.17.2 lib/bmg/operator/shared/unary.rb
bmg-0.17.1 lib/bmg/operator/shared/unary.rb
bmg-0.17.0 lib/bmg/operator/shared/unary.rb