Class: Dynamicloud::API::Criteria::GreaterLesser
- Defined in:
- lib/dynamic_criteria.rb
Overview
End of ExistsCondition class
Constant Summary
Constants inherited from Condition
Condition::ROOT, Condition::WITHOUT
Instance Method Summary collapse
-
#initialize(left, right, greater_lesser) ⇒ GreaterLesser
constructor
A new instance of GreaterLesser.
-
#to_record_string(parent) ⇒ Object
This method will return a String of this condition.
Constructor Details
#initialize(left, right, greater_lesser) ⇒ GreaterLesser
Returns a new instance of GreaterLesser.
229 230 231 232 233 234 |
# File 'lib/dynamic_criteria.rb', line 229 def initialize(left, right, greater_lesser) @greater_lesser = greater_lesser @left = left @right = right @need_quotes = right.is_a?(String) end |
Instance Method Details
#to_record_string(parent) ⇒ Object
This method will return a String of this condition
239 240 241 242 243 244 |
# File 'lib/dynamic_criteria.rb', line 239 def to_record_string(parent) '"' + @left + '": { ' + (@greater_lesser == '>' ? '"$gt"' : '"$lt"') + ': ' + (@need_quotes ? '"' : '') + @right.to_s + (@need_quotes ? '"' : '') + ' }' end |