Class: Bandwidth::Account

Inherits:
Object
  • Object
show all
Extended by:
ClientWrapper
Defined in:
lib/bandwidth/account.rb

Overview

Account API allows you to retrieve your current balance, transaction list, account type and all elements related to your platform account.

Class Method Summary collapse

Methods included from ClientWrapper

wrap_client_arg

Class Method Details

.get(client) ⇒ Hash

Get information about your account

Examples:

 = Account.get(client)

Parameters:

  • client (Client)

    optional client instance to make requests

Returns:

  • (Hash)

    account information



12
13
14
# File 'lib/bandwidth/account.rb', line 12

def self.get(client)
  client.make_request(:get, client.concat_user_path(ACCOUNT_PATH))[0]
end

.get_transactions(client, query = {}) ⇒ Array

Get a list of the transactions made to your account

Examples:

transactions = Account.get_transactions(client)

Parameters:

  • client (Client)

    optional client instance to make requests

  • query (Hash) (defaults to: {})

    optional query hash

Returns:

  • (Array)

    list of transactions



23
24
25
# File 'lib/bandwidth/account.rb', line 23

def self.get_transactions(client, query={})
  client.make_request(:get, client.concat_user_path(ACCOUNT_PATH + "/transactions"), query)[0]
end