Class: Window
- Inherits:
-
Expression
- Object
- Expression
- Window
- Defined in:
- lib/eno.rb
Instance Attribute Summary
Attributes inherited from Expression
Instance Method Summary collapse
-
#initialize(sym, &block) ⇒ Window
constructor
A new instance of Window.
- #to_sql ⇒ Object
Methods inherited from Expression
#!=, #!@, #%, #&, #*, #+, #-, #/, #<, #<=, #==, #>, #>=, #as, #desc, #inner_join, #join, #not_null?, #null?, #over, quote, #|
Constructor Details
#initialize(sym, &block) ⇒ Window
Returns a new instance of Window.
344 345 346 347 |
# File 'lib/eno.rb', line 344 def initialize(sym, &block) super(sym) @block = block end |
Instance Method Details
#to_sql ⇒ Object
349 350 351 352 353 354 |
# File 'lib/eno.rb', line 349 def to_sql "window %s as %s" % [ Expression.quote(@members.first), WindowExpression.new(&@block).to_sql ] end |