Class: SqlStmt::FromQuery
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Query
#fields, #joins, #tables, #wheres
Instance Method Summary collapse
- #group_by(clause) ⇒ Object
- #having(*sql) ⇒ Object
-
#initialize ⇒ FromQuery
constructor
A new instance of FromQuery.
- #order_by(clause) ⇒ Object
Methods inherited from Query
#includes_table?, #join, #left_join, #limit, #no_where, #optional_join, #optional_where, #table, #to_s, #where
Constructor Details
#initialize ⇒ FromQuery
Returns a new instance of FromQuery.
6 7 8 9 10 11 |
# File 'lib/sqlstmt/from_query.rb', line 6 def initialize super @group_by = nil @order_by = nil @having = [] end |
Instance Method Details
#group_by(clause) ⇒ Object
13 14 15 16 |
# File 'lib/sqlstmt/from_query.rb', line 13 def group_by(clause) @group_by = clause self end |
#having(*sql) ⇒ Object
23 24 25 26 |
# File 'lib/sqlstmt/from_query.rb', line 23 def having(*sql) @having.concat(sql) self end |
#order_by(clause) ⇒ Object
18 19 20 21 |
# File 'lib/sqlstmt/from_query.rb', line 18 def order_by(clause) @order_by = clause self end |