Class: Dynamicloud::API::Criteria::ANDCondition
- Defined in:
- lib/dynamic_criteria.rb
Overview
End of JoinClause class
Constant Summary
Constants inherited from Condition
Condition::ROOT, Condition::WITHOUT
Instance Method Summary collapse
-
#initialize(left, right) ⇒ ANDCondition
constructor
Will build an and condition using two part.
-
#to_record_string(parent) ⇒ Object
This method will return a String of this condition.
Constructor Details
#initialize(left, right) ⇒ ANDCondition
Will build an and condition using two part.
85 86 87 88 89 90 91 92 |
# File 'lib/dynamic_criteria.rb', line 85 def initialize(left, right) unless (left.is_a?(Condition)) || (right.is_a?(Condition)) raise 'left and right should implement Condition' end @left = left @right = right end |
Instance Method Details
#to_record_string(parent) ⇒ Object
This method will return a String of this condition
97 98 99 |
# File 'lib/dynamic_criteria.rb', line 97 def to_record_string(parent) (parent.is_a?(ORCondition) ? '"where": {' : '') + @left.to_record_string(self) + ',' + @right.to_record_string(self) + (parent.is_a?(ORCondition) ? '}' : '') end |