Class: Dynamicloud::API::Criteria::LikeCondition
- Defined in:
- lib/dynamic_criteria.rb
Overview
This class represents a like condition left like ‘%som%thing%’
Constant Summary
Constants inherited from Condition
Condition::ROOT, Condition::WITHOUT
Instance Method Summary collapse
-
#initialize(left, right, not_like = false) ⇒ LikeCondition
constructor
This constructor will build a like condition using left and right part.
-
#to_record_string(parent) ⇒ Object
This method will return a String of this condition.
Constructor Details
#initialize(left, right, not_like = false) ⇒ LikeCondition
This constructor will build a like condition using left and right part.
289 290 291 292 293 |
# File 'lib/dynamic_criteria.rb', line 289 def initialize(left, right, not_like = false) @left = left @right = right @not_like = not_like end |
Instance Method Details
#to_record_string(parent) ⇒ Object
This method will return a String of this condition
298 299 300 |
# File 'lib/dynamic_criteria.rb', line 298 def to_record_string(parent) '"' + @left + '": { "$' + (@not_like ? 'n' : '') + 'like" : ' + '"' + @right + '"' + ' }' end |