Class: TalkboxApi::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/talkbox_api/account.rb

Overview

Account resource class This class provides methods for interacting with the Talkbox API account resource.

Instance Method Summary collapse

Constructor Details

#initialize(conn) ⇒ Account

Returns a new instance of Account.



7
8
9
# File 'lib/talkbox_api/account.rb', line 7

def initialize(conn)
  @conn = conn
end

Instance Method Details

#getHash

Retrieves the account details

Returns:

  • (Hash)

    The account details



13
14
15
16
# File 'lib/talkbox_api/account.rb', line 13

def get
  resp = @conn.get("#{PATH_PREFIX}/account")
  resp.body
end

#update(details = {}) ⇒ Hash

Updates the account details

Parameters:

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

    The account details to update

Returns:

  • (Hash)

    The updated account details



21
22
23
# File 'lib/talkbox_api/account.rb', line 21

def update(details = {})
  @conn.put("#{PATH_PREFIX}/account", details.to_json, { "Content-Type" => "application/json" }).body
end