Sha256: 5bdb007ea3a6033824933c371a15ea4128f565e8ca5335e94e7c5191db81b065

Contents?: true

Size: 719 Bytes

Versions: 36

Compression:

Stored size: 719 Bytes

Contents

# frozen_string_literal: true

module Arel # :nodoc: all
  module Nodes
    class Unary < Arel::Nodes::NodeExpression
      attr_accessor :expr
      alias :value :expr

      def initialize(expr)
        super()
        @expr = expr
      end

      def hash
        @expr.hash
      end

      def eql?(other)
        self.class == other.class &&
          self.expr == other.expr
      end
      alias :== :eql?
    end

    %w{
      Bin
      Cube
      DistinctOn
      Group
      GroupingElement
      GroupingSet
      Lateral
      Limit
      Lock
      Not
      Offset
      On
      OptimizerHints
      Ordering
      RollUp
    }.each do |name|
      const_set(name, Class.new(Unary))
    end
  end
end

Version data entries

36 entries across 36 versions & 4 rubygems

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