class Arel::Nodes::Window

Attributes

framing[RW]
orders[RW]

Public Class Methods

new() click to toggle source
# File lib/arel/nodes/window.rb, line 7
def initialize
  @orders = []
end

Public Instance Methods

==(other)
Alias for: eql?
eql?(other) click to toggle source
# File lib/arel/nodes/window.rb, line 40
def eql? other
  self.class == other.class &&
    self.orders == other.orders &&
    self.framing == other.framing
end
Also aliased as: ==
frame(expr) click to toggle source
# File lib/arel/nodes/window.rb, line 19
def frame(expr)
  @framing = expr
end
hash() click to toggle source
# File lib/arel/nodes/window.rb, line 36
def hash
  [@orders, @framing].hash
end
initialize_copy(other) click to toggle source
Calls superclass method
# File lib/arel/nodes/window.rb, line 31
def initialize_copy other
  super
  @orders = @orders.map { |x| x.clone }
end
order(*expr) click to toggle source
# File lib/arel/nodes/window.rb, line 11
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
range(expr = nil) click to toggle source
# File lib/arel/nodes/window.rb, line 27
def range(expr = nil)
  frame(Range.new(expr))
end
rows(expr = nil) click to toggle source
# File lib/arel/nodes/window.rb, line 23
def rows(expr = nil)
  frame(Rows.new(expr))
end