Class: Parse::Model

Inherits:
Object
  • Object
show all
Defined in:
lib/parse/model.rb

Overview

A meta object to find objects by object id

Instance Attribute Summary

Attributes inherited from Object

#class_name, #client, #created_at, #parse_object_id, #updated_at

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Object

#array_add, #array_add_relation, #array_add_unique, #array_remove, #array_remove_relation, #decrement, #eql?, #get, #hash, #increment, #inspect, #new?, #parse_delete, #pointer, #refresh, #rest_api_hash, #safe_hash, #save, #should_call_to_h?, #to_h, #to_json, #to_s, #update_attributes, #uri

Constructor Details

#initialize(data = nil, parse_client = nil) ⇒ Model

Returns a new instance of Model.



5
6
7
# File 'lib/parse/model.rb', line 5

def initialize(data = nil, parse_client = nil)
  super(self.class.to_s, data, parse_client || Parse.client)
end

Class Method Details

.find(object_id, client = nil) ⇒ Object



9
10
11
12
# File 'lib/parse/model.rb', line 9

def self.find(object_id, client = nil)
  data = Parse::Query.new(to_s, client).eq('objectId', object_id).first
  new(data, client)
end