Class: DoList::AuthToken
- Inherits:
-
Object
- Object
- DoList::AuthToken
- Defined in:
- lib/do-list/auth_token.rb
Instance Method Summary collapse
- #auth_key ⇒ Object
-
#initialize(params = {}) ⇒ AuthToken
constructor
A new instance of AuthToken.
Constructor Details
#initialize(params = {}) ⇒ AuthToken
Returns a new instance of AuthToken.
5 6 7 8 9 10 11 12 |
# File 'lib/do-list/auth_token.rb', line 5 def initialize(params = {}) @headers = params[:headers] @account_id = params[:account_id] @api_key = params[:api_key] @uri = DoList::UrlParser.parse_url(params[:url]) @http = DoList::UrlParser.request_http(@uri) @auth_key, @auth_depr_date = request_auth_key end |
Instance Method Details
#auth_key ⇒ Object
14 15 16 17 |
# File 'lib/do-list/auth_token.rb', line 14 def auth_key @auth_key, @auth_depr_date = request_auth_key if (DateTime.now + (1 / 24.0)) > @auth_depr_date @auth_key end |