Class: TalkboxApi::Account
- Inherits:
-
Object
- Object
- TalkboxApi::Account
- 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
-
#get ⇒ Hash
Retrieves the account details.
-
#initialize(conn) ⇒ Account
constructor
A new instance of Account.
-
#update(details = {}) ⇒ Hash
Updates the account details.
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
#get ⇒ Hash
Retrieves 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
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 |