Class: LC::Model

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

Instance Attribute Summary

Attributes inherited from Object

#class_name, #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) ⇒ Model

Returns a new instance of Model.



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

def initialize(data=nil)
  super(self.class.to_s,data)
end

Class Method Details

.find(object_id) ⇒ Object



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

def self.find(object_id)
  self.new LC::Query.new(self.to_s).eq('objectId',object_id).first
end