Sha256: 428fa7155b11c820f8edc997ff39cfc24d939c63223eded2a95cfc32f54ea419

Contents?: true

Size: 1.59 KB

Versions: 15

Compression:

Stored size: 1.59 KB

Contents

module Arel
  module Nodes
    class SelectCore < Arel::Nodes::Node
      attr_accessor :top, :projections, :wheres, :groups, :windows
      attr_accessor :havings, :source, :set_quantifier

      def initialize
        super()
        @source         = JoinSource.new nil
        @top            = nil

        # http://savage.net.au/SQL/sql-92.bnf.html#set%20quantifier
        @set_quantifier = nil
        @projections    = []
        @wheres         = []
        @groups         = []
        @havings        = []
        @windows        = []
      end

      def from
        @source.left
      end

      def from= value
        @source.left = value
      end

      alias :froms= :from=
      alias :froms :from

      def initialize_copy other
        super
        @source      = @source.clone if @source
        @projections = @projections.clone
        @wheres      = @wheres.clone
        @groups      = @groups.clone
        @havings     = @havings.clone
        @windows     = @windows.clone
      end

      def hash
        [
          @source, @top, @set_quantifier, @projections,
          @wheres, @groups, @havings, @windows
        ].hash
      end

      def eql? other
        self.class == other.class &&
          self.source == other.source &&
          self.top == other.top &&
          self.set_quantifier == other.set_quantifier &&
          self.projections == other.projections &&
          self.wheres == other.wheres &&
          self.groups == other.groups &&
          self.havings == other.havings &&
          self.windows == other.windows
      end
      alias :== :eql?
    end
  end
end

Version data entries

15 entries across 15 versions & 4 rubygems

Version Path
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/arel-7.1.4/lib/arel/nodes/select_core.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-7.1.4/lib/arel/nodes/select_core.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-7.1.4/lib/arel/nodes/select_core.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-7.1.4/lib/arel/nodes/select_core.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-7.1.4/lib/arel/nodes/select_core.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-7.1.4/lib/arel/nodes/select_core.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-7.1.4/lib/arel/nodes/select_core.rb
autocompl-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-7.1.4/lib/arel/nodes/select_core.rb
abaci-0.3.0 vendor/bundle/gems/arel-7.1.0/lib/arel/nodes/select_core.rb
arel-7.1.4 lib/arel/nodes/select_core.rb
arel-7.1.3 lib/arel/nodes/select_core.rb
arel-7.1.2 lib/arel/nodes/select_core.rb
arel-7.1.1 lib/arel/nodes/select_core.rb
arel-7.1.0 lib/arel/nodes/select_core.rb
arel-7.0.0 lib/arel/nodes/select_core.rb