lib/parse/query.rb
def conditions(expressions = {})
      expressions.each do |expression, value|
        if expression == :order
          order value
        elsif expression == :keys
          keys value
        elsif expression == :key
          keys [value]
        elsif expression == :skip
          skip value
        elsif expression == :limit
          limit value
        elsif expression == :include || expression == :includes
          includes(value)
        elsif expression == :cache
          self.cache = value
        elsif expression == :use_master_key
          self.use_master_key = value
        elsif expression == :session
          # you can pass a session token or a Parse::Session
          self.session_token = value
        else
          add_constraint(expression, value)
        end
      end # each
      self #chaining
    end
def conditions(expressions = {})
      expressions.each do |expression, value|
        if expression == :order
          order value
        elsif expression == :keys
          keys value
        elsif expression == :key
          keys [value]
        elsif expression == :skip
          skip value
        elsif expression == :limit
          limit value
        elsif expression == :include || expression == :includes
          includes(value)
        elsif expression == :cache
          self.cache = value
        elsif expression == :use_master_key
          self.use_master_key = value
        elsif expression == :session
          # you can pass a session token or a Parse::Session
          self.session_token = value
        else
          add_constraint(expression, value)
        end
      end # each
      self #chaining
    end
def conditions ( expressions = { } ) expressions . each do | expression , value | if expression == :order order value elsif expression == :keys keys value elsif expression == :key keys [ value ] elsif expression == :skip skip value elsif expression == :limit limit value elsif expression == :include || expression == :includes includes ( value ) elsif expression == :cache self . cache = value elsif expression == :use_master_key self . use_master_key = value elsif expression == :session # you can pass a session token or a Parse::Session self . session_token = value else add_constraint ( expression , value ) end end # each self #chaining end
Constructor method to create a query with constraints for a specific Parse collection.
 Also sets the default limit count to `:max`.
 @overload new(table)
   Create a query for this Parse collection name.
   @example
     Parse::Query.new "_User"
     Parse::Query.new "_Installation", :device_type => 'ios'
   @param table [String] the name of the Parse collection to query. (ex. "_User")
   @param constraints [Hash] a set of query constraints.
 @overload new(parseSubclass)
   Create a query for this Parse model (or anything that responds to {Parse::Object.parse_class}).
   @example
     Parse::Query.new Parse::User
     # assume Post < Parse::Object
     Parse::Query.new Post, like_count.gt => 0
   @param parseSubclass [Parse::Object] the Parse model constant
   @param constraints [Hash] a set of query constraints.
 @return [Query] a new query for the Parse collection with the passed in constraints.
 initialize
 Add a set of query expressions and constraints.
 @example
  query.conditions({:field.gt => value})
 @param expressions [Hash] containing key value pairs of Parse::Operations
   and their value.
 @return [self]
Constructor method to create a query with constraints for a specific Parse collection . Also sets the default limit count to : max .