Class: Bitodeme::Auth
- Inherits:
-
Object
- Object
- Bitodeme::Auth
- Extended by:
- Forwardable
- Includes:
- Singleton
- Defined in:
- lib/bitodeme/auth.rb
Overview
OAuth2 client credentials authenticator for Bitodeme
Class Method Summary collapse
Instance Method Summary collapse
- #inspect ⇒ Object
-
#token ⇒ Object
Valid access token for Bitodeme endpoints.
Class Method Details
.build ⇒ Object
9 10 11 |
# File 'lib/bitodeme/auth.rb', line 9 def self.build $bitodeme_auth ||= instance end |
Instance Method Details
#inspect ⇒ Object
19 20 21 22 23 |
# File 'lib/bitodeme/auth.rb', line 19 def inspect "#<#{self.class.name}:0x#{(object_id << 1).to_s(16)} " \ "hostname=\"#{hostname}\" client_id=\"#{client_id}\" " \ "client_secret=\"#{client_secret}\">" end |
#token ⇒ Object
Valid access token for Bitodeme endpoints
14 15 16 17 |
# File 'lib/bitodeme/auth.rb', line 14 def token reset_token if expired? access_token end |