class Dynamicloud::API::Criteria::GreaterLesser

End of ExistsCondition class

Public Class Methods

new(left, right, greater_lesser) click to toggle source
# 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

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 239
def to_record_string(parent)
  '"' + @left + '": { ' +
      (@greater_lesser == '>' ? '"$gt"' : '"$lt"') + ': ' +
      (@need_quotes ? '"' : '') + @right.to_s + (@need_quotes ? '"' : '') +
      ' }'
end