Class: Cassava::SelectClause
- Inherits:
-
Struct
- Object
- Struct
- Cassava::SelectClause
- Defined in:
- lib/cassava/client.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#count_boolean ⇒ Object
Returns the value of attribute count_boolean.
-
#table ⇒ Object
Returns the value of attribute table.
Instance Method Summary collapse
Instance Attribute Details
permalink #columns ⇒ Object
Returns the value of attribute columns
170 171 172 |
# File 'lib/cassava/client.rb', line 170 def columns @columns end |
permalink #count_boolean ⇒ Object
Returns the value of attribute count_boolean
170 171 172 |
# File 'lib/cassava/client.rb', line 170 def count_boolean @count_boolean end |
permalink #table ⇒ Object
Returns the value of attribute table
170 171 172 |
# File 'lib/cassava/client.rb', line 170 def table @table end |
Instance Method Details
permalink #count ⇒ Object
[View source]
171 172 173 |
# File 'lib/cassava/client.rb', line 171 def count self.class.new(table, _columns = nil, _count_boolean = true) end |
permalink #to_s ⇒ Object
[View source]
175 176 177 178 179 180 181 182 |
# File 'lib/cassava/client.rb', line 175 def to_s if count_boolean "SELECT COUNT(*) FROM #{table}" else self.columns ||= ['*'] "SELECT #{columns.join(', ')} from #{table}" end end |