Sha256: 55f9a08a017f2f6cb7ac98b95d4da2c2183c590e7ce915af5829b704d3fefc55

Contents?: true

Size: 893 Bytes

Versions: 4

Compression:

Stored size: 893 Bytes

Contents

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

      def initialize left, right
        @left  = left
        @right = right
      end

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

      def hash
        [@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
      DoesNotMatch
      GreaterThan
      GreaterThanOrEqual
      Join
      LessThan
      LessThanOrEqual
      Matches
      NotEqual
      NotIn
      Or
      Union
      UnionAll
      Intersect
      Except
    }.each do |name|
      const_set name, Class.new(Binary)
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
challah-1.0.0 vendor/bundle/gems/arel-4.0.0/lib/arel/nodes/binary.rb
arel-4.0.0 lib/arel/nodes/binary.rb
arel-4.0.0.beta2 lib/arel/nodes/binary.rb
arel-4.0.0.beta1 lib/arel/nodes/binary.rb