Class: PerfectAudit::AuthToken

Inherits:
Object
  • Object
show all
Extended by:
Dry::Initializer
Defined in:
lib/perfect_audit/auth_token.rb

Constant Summary collapse

AUTH_PATH =
'https://auth.ocrolus.com/oauth/token'

Instance Method Summary collapse

Instance Method Details

#expired?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/perfect_audit/auth_token.rb', line 21

def expired?
  @token.nil? || Time.now >= @expires_at
end

#getObject



15
16
17
18
19
# File 'lib/perfect_audit/auth_token.rb', line 15

def get
  request if expired?

  @token
end