class SoapyBing::Accounts

Attributes

service[R]

Public Class Methods

new(*args) click to toggle source
# File lib/soapy_bing/accounts.rb, line 7
def initialize(*args)
  @service = Service.customer_management(*args)
end

Public Instance Methods

list() click to toggle source
# File lib/soapy_bing/accounts.rb, line 11
def list
  response = service.get_accounts_info
  Array.wrap(response[:accounts_info][:account_info]).map do |account_info|
    build_account(account_info)
  end
end

Private Instance Methods

build_account(account_info) click to toggle source
# File lib/soapy_bing/accounts.rb, line 20
def build_account(account_info)
  Account.new(
    developer_token: service.customer.developer_token,
    customer_id: service.customer.customer_id,
    account_id: account_info[:id]
  )
end