Method: Parse::Query#initialize
- Defined in:
- lib/parse/query.rb
#new(table) ⇒ Query #new(parseSubclass) ⇒ Query
Constructor method to create a query with constraints for a specific Parse collection. Also sets the default limit count to :max.
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/parse/query.rb', line 286 def initialize(table, constraints = {}) table = table.to_s.to_parse_class if table.is_a?(Symbol) table = table.parse_class if table.respond_to?(:parse_class) raise ArgumentError, "First parameter should be the name of the Parse class (table)" unless table.is_a?(String) @count = 0 #non-zero/1 implies a count query request @where = [] @order = [] @keys = [] @includes = [] @limit = nil @skip = 0 @table = table @cache = true @use_master_key = true conditions constraints end |