Method: Parse::Constraint#build

Defined in:
lib/parse/query/constraint.rb

#buildHash

Builds the JSON hash representation of this constraint for a Parse query. This method should be overriden by subclasses. The default implementation implements buildling the equality constraint.

Returns:

Raises:

  • ArgumentError if the constraint could be be build due to a bad parameter. This will be different depending on the constraint subclass.



173
174
175
176
# File 'lib/parse/query/constraint.rb', line 173

def build
  return { @operation.operand => formatted_value } if @operation.operator == :eq || key.nil?
  { @operation.operand => { key => formatted_value } }
end