module ParseResource::QueryMethods::ClassMethods

Public Instance Methods

all() click to toggle source

Find all ParseResource::Base objects for that model.

@return [Array] an `Array` of objects that subclass `ParseResource`.

# File lib/parse_resource/query_methods.rb, line 25
def all
  Query.new(self).all
end
count() click to toggle source

Add this at the end of a method chain to get the count of objects, instead of an Array of objects

# File lib/parse_resource/query_methods.rb, line 17
def count
  #https://www.parse.com/docs/rest#queries-counting
  Query.new(self).count(1)
end
first() click to toggle source

Find the first object. Fairly random, not based on any specific condition.

# File lib/parse_resource/query_methods.rb, line 31
def first
  Query.new(self).limit(1).first
end
include_object(parent) click to toggle source

Include the attributes of a parent ojbect in the results Similar to ActiveRecord eager loading

# File lib/parse_resource/query_methods.rb, line 12
def include_object(parent)
  Query.new(self).include_object(parent)
end
limit(n) click to toggle source

Limits the number of objects returned

# File lib/parse_resource/query_methods.rb, line 37
def limit(n)
  Query.new(self).limit(n)
end
near(near, geo_point, options={}) click to toggle source
# File lib/parse_resource/query_methods.rb, line 51
def near(near, geo_point, options={})
  Query.new(self).near(near, geo_point, options)
end
order(attr) click to toggle source
# File lib/parse_resource/query_methods.rb, line 47
      def order(attr)
        Query.new(self).order(attr)
end
skip(n) click to toggle source

Skip the number of objects

# File lib/parse_resource/query_methods.rb, line 43
def skip(n)
  Query.new(self).skip(n)
end
within_box(near, geo_point_south, geo_point_north) click to toggle source
# File lib/parse_resource/query_methods.rb, line 55
def within_box(near, geo_point_south, geo_point_north)
  Query.new(self).within_box(near, geo_point_south, geo_point_north)
end