Sha256: 9599fe476593b507aa85ea6d4f87290661e961bc2c00900b02ce0d77975fa74d
Contents?: true
Size: 836 Bytes
Versions: 34
Compression:
Stored size: 836 Bytes
Contents
require 'restful_model' module Inbox class Account < RestfulModel parameter :account_id parameter :trial parameter :trial_expires parameter :sync_state parameter :billing_state 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| # Throw any exceptions json = Inbox.interpret_response(result, response, :expected_class => Object) end end def upgrade! _perform_account_action!('upgrade') end def downgrade! _perform_account_action!('downgrade') end end end
Version data entries
34 entries across 34 versions & 2 rubygems