Class: Dynamicloud::API::Criteria::GroupByClause
- Defined in:
- lib/dynamic_criteria.rb
Overview
This class represents a GroupBy clause.
Constant Summary
Constants inherited from Condition
Condition::ROOT, Condition::WITHOUT
Instance Method Summary collapse
-
#initialize(attributes) ⇒ GroupByClause
constructor
Constructor tha builds this condition.
-
#to_record_string(parent) ⇒ Object
This method will return a String of this condition.
Constructor Details
#initialize(attributes) ⇒ GroupByClause
Constructor tha builds this condition
388 389 390 |
# File 'lib/dynamic_criteria.rb', line 388 def initialize(attributes) @attributes = attributes end |
Instance Method Details
#to_record_string(parent) ⇒ Object
This method will return a String of this condition
395 396 397 398 399 400 401 402 403 404 |
# File 'lib/dynamic_criteria.rb', line 395 def to_record_string(parent) group_by = '"groupBy": [' attrs = '' @attributes.each do |attr| attrs = attrs + (attrs.length == 0 ? '' : ',') + '"' + attr + '"'; end group_by + attrs + ']' end |