Class: Playapi::Account

Inherits:
Identity show all
Extended by:
Utils
Defined in:
lib/playapi/account.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Utils

hi

Methods inherited from Identity

#==, fetch, #id, #initialize, store

Methods inherited from Base

#[], attr_reader, #attrs, fetch, fetch_or_new, from_response, identity_map, #initialize, store, #update

Constructor Details

This class inherits a constructor from Playapi::Identity

Instance Attribute Details

#service_idObject (readonly)

Returns the value of attribute service_id.



8
9
10
# File 'lib/playapi/account.rb', line 8

def service_id
  @service_id
end

#service_nameObject (readonly)

Returns the value of attribute service_name.



8
9
10
# File 'lib/playapi/account.rb', line 8

def service_name
  @service_name
end

Class Method Details

.get(id) ⇒ Object



21
22
23
24
# File 'lib/playapi/account.rb', line 21

def get(id)
	url = "api/v2/accounts/#{id}"
	get_object(:get, "account", url)
end

.listObject



16
17
18
19
# File 'lib/playapi/account.rb', line 16

def list
	url = "api/v2/accounts"
	get_objects(:get, "accounts", url)
end

.update(id, opts) ⇒ Object



26
27
28
29
# File 'lib/playapi/account.rb', line 26

def update(id, opts)
	url = "api/v2/accounts/#{id}"
	get_object(:put, "account", url, {:account => opts})
end

Instance Method Details

#pushObject



10
11
12
# File 'lib/playapi/account.rb', line 10

def push
	self.attrs = Playapi::Account.update(id, @attrs).attrs
end