Class: Bitodeme::Auth

Inherits:
Object
  • Object
show all
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

Class Method Details

.buildObject



9
10
11
# File 'lib/bitodeme/auth.rb', line 9

def self.build
  $bitodeme_auth ||= instance
end

Instance Method Details

#inspectObject



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

#tokenObject

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