module OnSIP::Account::ClassMethods

Public Instance Methods

edit_add_credit(*args) click to toggle source

TODO

# File lib/onsip/models/account.rb, line 52
def edit_add_credit(*args)
  raise NotImplementedError
end
edit_contact(*args) click to toggle source

TODO

# File lib/onsip/models/account.rb, line 47
def edit_contact(*args)
  raise NotImplementedError
end
edit_recharge(*args) click to toggle source

TODO

# File lib/onsip/models/account.rb, line 57
def edit_recharge(*args)
  raise NotImplementedError
end
invoice_browse(*args) click to toggle source

TODO

# File lib/onsip/models/account.rb, line 67
def invoice_browse(*args)
  raise NotImplementedError
end
invoice_read(*args) click to toggle source

TODO

# File lib/onsip/models/account.rb, line 62
def invoice_read(*args)
  raise NotImplementedError
end
process_read_account_response(response) click to toggle source
# File lib/onsip/models/account.rb, line 36
def process_read_account_response(response)
  account = nil

  key_path = %w(Response Result AccountRead Account)
  a = ResponseParser.parse_response response, key_path
  account = (a.map { |h| new h }).first if a

  account
end
read(account_id) { |response| ... } click to toggle source
# File lib/onsip/models/account.rb, line 30
def read(account_id)
  response = OnSIP.connection.get('/api', {'Action' => 'AccountRead', 'AccountId' => account_id, 'SessionId' => OnSIP.session.id, 'Output' => 'json'}, {})
  yield response if block_given?
  process_read_account_response response
end