Sha256: af1086000058f286fa96f91c75f5e1271466d1d4b38957610945786eadc472d0

Contents?: true

Size: 917 Bytes

Versions: 16

Compression:

Stored size: 917 Bytes

Contents

module Arel
  module Nodes
    class Binary < Arel::Nodes::Node
      attr_accessor :left, :right

      def initialize left, right
        super()
        @left  = left
        @right = right
      end

      def initialize_copy other
        super
        @left  = @left.clone if @left
        @right = @right.clone if @right
      end

      def hash
        [self.class, @left, @right].hash
      end

      def eql? other
        self.class == other.class &&
          self.left == other.left &&
          self.right == other.right
      end
      alias :== :eql?
    end

    %w{
      As
      Assignment
      Between
      GreaterThan
      GreaterThanOrEqual
      Join
      LessThan
      LessThanOrEqual
      NotEqual
      NotIn
      NotRegexp
      Or
      Regexp
      Union
      UnionAll
      Intersect
      Except
    }.each do |name|
      const_set name, Class.new(Binary)
    end
  end
end

Version data entries

16 entries across 16 versions & 7 rubygems

Version Path
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/arel-6.0.4/lib/arel/nodes/binary.rb
arel-6.0.4 lib/arel/nodes/binary.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-6.0.3/lib/arel/nodes/binary.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/arel-6.0.3/lib/arel/nodes/binary.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/arel-6.0.3/lib/arel/nodes/binary.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/arel-6.0.3/lib/arel/nodes/binary.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/arel-6.0.3/lib/arel/nodes/binary.rb
arel-6.0.3 lib/arel/nodes/binary.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/arel-6.0.0/lib/arel/nodes/binary.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/arel-6.0.0/lib/arel/nodes/binary.rb
arel-6.0.2 lib/arel/nodes/binary.rb
arel-6.0.1 lib/arel/nodes/binary.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/arel-6.0.0/lib/arel/nodes/binary.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/arel-6.0.0/lib/arel/nodes/binary.rb
arel-6.0.0 lib/arel/nodes/binary.rb
arel-6.0.0.beta2 lib/arel/nodes/binary.rb