Sha256: 48d3481de59c6cdd81d517d798684a43e8655aeb7c05e0002b422bfb01e205c1

Contents?: true

Size: 946 Bytes

Versions: 39

Compression:

Stored size: 946 Bytes

Contents

# frozen_string_literal: true

module Arel # :nodoc: all
  module Nodes
    class Binary < Arel::Nodes::NodeExpression
      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
      Or
      Union
      UnionAll
      Intersect
      Except
    }.each do |name|
      const_set name, Class.new(Binary)
    end
  end
end

Version data entries

39 entries across 39 versions & 4 rubygems

Version Path
activerecord-6.0.6.1 lib/arel/nodes/binary.rb
activerecord-6.0.6 lib/arel/nodes/binary.rb
activerecord-6.0.5.1 lib/arel/nodes/binary.rb
activerecord-6.0.5 lib/arel/nodes/binary.rb
activerecord-6.0.4.8 lib/arel/nodes/binary.rb
activerecord-6.0.4.7 lib/arel/nodes/binary.rb
activerecord-6.0.4.6 lib/arel/nodes/binary.rb
activerecord-6.0.4.5 lib/arel/nodes/binary.rb
activerecord-6.0.4.4 lib/arel/nodes/binary.rb
activerecord-6.0.4.3 lib/arel/nodes/binary.rb
activerecord-6.0.4.2 lib/arel/nodes/binary.rb
activerecord-6.0.4.1 lib/arel/nodes/binary.rb
activerecord-6.0.4 lib/arel/nodes/binary.rb
activerecord-6.0.3.7 lib/arel/nodes/binary.rb
activerecord-6.0.3.6 lib/arel/nodes/binary.rb
activerecord-6.0.3.5 lib/arel/nodes/binary.rb
activerecord-6.0.3.4 lib/arel/nodes/binary.rb
activerecord-6.0.3.3 lib/arel/nodes/binary.rb
activerecord-6.0.3.2 lib/arel/nodes/binary.rb
activerecord-6.0.3.1 lib/arel/nodes/binary.rb