Class: FetchAppAPI::Account
- Defined in:
- lib/fetchapp-api-ruby/account.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
Class Method Summary collapse
-
.details ⇒ Object
Retrieves information about the Account.
-
.new_token ⇒ Object
Generates a new API token.
Methods inherited from Base
basic_auth, can_connect?, find, #initialize, key, time
Constructor Details
This class inherits a constructor from FetchAppAPI::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class FetchAppAPI::Base
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/fetchapp-api-ruby/account.rb', line 3 def attributes @attributes end |
Class Method Details
.details ⇒ Object
Retrieves information about the Account
9 10 11 12 13 |
# File 'lib/fetchapp-api-ruby/account.rb', line 9 def self.details account = Account.new({}) account.attributes = execute(:get, "/account")["account"] account end |
.new_token ⇒ Object
Generates a new API token. Subsequent API calls using the existing token will be refused.
17 18 19 20 21 22 23 24 |
# File 'lib/fetchapp-api-ruby/account.rb', line 17 def self.new_token token = execute(:get, "/new_token") unless token["message"].nil? || token["message"].empty? # Reauthorize Connector.basic_auth(FetchAppAPI::Base.key, token["message"]) token end end |