Class: Arel::Nodes::Window
Do not use. This class is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
|
|
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Node
|
|
Instance Chain:
self,
Node ,
::Arel::FactoryMethods
|
|
Inherits: |
Arel::Nodes::Node
|
Defined in: | activerecord/lib/arel/nodes/window.rb |
Class Method Summary
- .new ⇒ Window constructor
Instance Attribute Summary
Instance Method Summary
-
#==(other)
Alias for #eql?.
- #eql?(other) ⇒ Boolean (also: #==)
- #frame(expr)
- #hash
- #initialize_copy(other)
- #order(*expr)
- #partition(*expr)
- #range(expr = nil)
- #rows(expr = nil)
Node
- Inherited
#and | Factory method to create an And node. |
#fetch_attribute, #invert, | |
#not | Factory method to create a |
#or | |
#to_sql | FIXME: this method should go away. |
::Arel::FactoryMethods
- Included
#cast, #coalesce, #create_and, #create_false, #create_join, #create_on, #create_string_join, #create_table_alias, #create_true, #grouping, | |
#lower | Create a LOWER() function. |
Constructor Details
.new ⇒ Window
# File 'activerecord/lib/arel/nodes/window.rb', line 8
def initialize @orders = [] @partitions = [] @framing = nil end
Instance Attribute Details
#framing (rw)
[ GitHub ]# File 'activerecord/lib/arel/nodes/window.rb', line 6
attr_accessor :orders, :framing, :partitions
#orders (rw)
[ GitHub ]# File 'activerecord/lib/arel/nodes/window.rb', line 6
attr_accessor :orders, :framing, :partitions
#partitions (rw)
[ GitHub ]Instance Method Details
#==(other)
Alias for #eql?.
# File 'activerecord/lib/arel/nodes/window.rb', line 65
alias :== :eql?
#eql?(other) ⇒ Boolean
Also known as: #==
# File 'activerecord/lib/arel/nodes/window.rb', line 59
def eql?(other) self.class == other.class && self.orders == other.orders && self.framing == other.framing && self.partitions == other.partitions end
#frame(expr)
[ GitHub ]# File 'activerecord/lib/arel/nodes/window.rb', line 30
def frame(expr) @framing = expr end
#hash
[ GitHub ]# File 'activerecord/lib/arel/nodes/window.rb', line 55
def hash [@orders, @framing].hash end
#initialize_copy(other)
[ GitHub ]# File 'activerecord/lib/arel/nodes/window.rb', line 50
def initialize_copy(other) super @orders = @orders.map { |x| x.clone } end
#order(*expr)
[ GitHub ]# File 'activerecord/lib/arel/nodes/window.rb', line 14
def order(*expr) # FIXME: We SHOULD NOT be converting these to SqlLiteral automatically @orders.concat expr.map { |x| String === x || Symbol === x ? Nodes::SqlLiteral.new(x.to_s) : x } self end
#partition(*expr)
[ GitHub ]# File 'activerecord/lib/arel/nodes/window.rb', line 22
def partition(*expr) # FIXME: We SHOULD NOT be converting these to SqlLiteral automatically @partitions.concat expr.map { |x| String === x || Symbol === x ? Nodes::SqlLiteral.new(x.to_s) : x } self end