Class: GoogleDataSource::DataSource::Sql::SelectRelation
- Inherits:
-
Relation
- Object
- WithHelpers
- Relation
- GoogleDataSource::DataSource::Sql::SelectRelation
- Defined in:
- lib/google_data_source/sql/models.rb
Instance Method Summary collapse
Methods inherited from Relation
Instance Method Details
#to_s ⇒ Object
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
# File 'lib/google_data_source/sql/models.rb', line 243 def to_s result = "select" result << " #{select.join(', ')}" unless where.nil? result << " where #{where}" end unless groupby.nil? result << " group by #{groupby}" end unless orderby.nil? result << " order by #{orderby.join(', ')}" end unless limit.nil? result << " limit #{limit}" end unless offset.nil? result << " offset #{offset}" end result end |