Class: Inbox::Account
Instance Method Summary
collapse
#==, #as_json, collection_name, #destroy, #inflate, #initialize, #save!, #update, #url
#time_attr_accessor
Methods included from Parameters
included, #parameters
Instance Method Details
12
13
14
15
16
17
18
19
20
|
# File 'lib/account.rb', line 12
def _perform_account_action!(action)
raise UnexpectedAccountAction.new unless action == "upgrade" || action == "downgrade"
collection = ManagementModelCollection.new(Account, @_api, @namespace_id, {:account_id=>@account_id})
::RestClient.post("#{collection.url}/#{@account_id}/#{action}",{}) do |response, request, result|
json = Inbox.interpret_response(result, response, :expected_class => Object)
end
end
|
#downgrade! ⇒ Object
26
27
28
|
# File 'lib/account.rb', line 26
def downgrade!
_perform_account_action!('downgrade')
end
|
#upgrade! ⇒ Object
22
23
24
|
# File 'lib/account.rb', line 22
def upgrade!
_perform_account_action!('upgrade')
end
|