class Dynamicloud::API::Criteria::LikeCondition

This class represents a like condition left like '%som%thing%' @author Eleazar Gomez @version 1.0.0 @since 8/23/15

Public Class Methods

new(left, right, not_like = false) click to toggle source

This constructor will build a like condition using left and right part. @param left left part of this like condition. @param right right part of this like condition.

# File lib/dynamic_criteria.rb, line 289
def initialize(left, right, not_like = false)
  @left = left
  @right = right
  @not_like = not_like
end

Public Instance Methods

to_record_string(parent) click to toggle source

This method will return a String of this condition @param parent this is the parent of this condition @return a json

# File lib/dynamic_criteria.rb, line 298
def to_record_string(parent)
  '"' + @left + '": { "$' + (@not_like ? 'n' : '') + 'like" : ' + '"' + @right + '"' + ' }'
end