Class: Parse::Installation
- Defined in:
- lib/parse/installation.rb
Overview
Installation object parseplatform.github.io/docs/rest/guide/#installations
Constant Summary collapse
- UPDATABLE_FIELDS =
{ badge: 'badge', channels: 'channels', time_zone: 'timeZone', device_type: 'deviceType', push_type: 'pushType', gcm_sender_id: 'GCMSenderId', device_token: 'deviceToken', channel_uris: 'channelUris', app_name: 'appName', app_version: 'appVersion', parse_version: 'parseVersion', app_identifier: 'appIdentifier' }
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Attributes inherited from Object
#class_name, #created_at, #parse_object_id, #updated_at
Class Method Summary collapse
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(parse_object_id, client = nil) ⇒ Installation
constructor
A new instance of Installation.
- #method ⇒ Object
- #rest_api_hash ⇒ Object
- #save ⇒ Object
- #uri ⇒ Object
Methods inherited from Object
#array_add, #array_add_relation, #array_add_unique, #array_remove, #array_remove_relation, #decrement, #eql?, #hash, #increment, #inspect, #new?, #parse_delete, #pointer, #refresh, #safe_hash, #should_call_to_h?, #to_h, #to_json, #to_s, #update_attributes
Constructor Details
#initialize(parse_object_id, client = nil) ⇒ Installation
Returns a new instance of Installation.
28 29 30 31 |
# File 'lib/parse/installation.rb', line 28 def initialize(parse_object_id, client = nil) @parse_object_id = parse_object_id @client = client || Parse.client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
11 12 13 |
# File 'lib/parse/installation.rb', line 11 def client @client end |
Class Method Details
Instance Method Details
#get ⇒ Object
38 39 40 41 |
# File 'lib/parse/installation.rb', line 38 def get response = client.request(uri, :get, nil, nil) parse Parse.parse_json(nil, response) if response end |
#method ⇒ Object
61 62 63 |
# File 'lib/parse/installation.rb', line 61 def method @parse_object_id ? :put : :post end |
#rest_api_hash ⇒ Object
57 58 59 |
# File 'lib/parse/installation.rb', line 57 def rest_api_hash self end |
#save ⇒ Object
53 54 55 |
# File 'lib/parse/installation.rb', line 53 def save client.request uri, method, to_json, nil end |
#uri ⇒ Object
49 50 51 |
# File 'lib/parse/installation.rb', line 49 def uri Protocol.installation_uri @parse_object_id end |