Class: Alloy::KYC::BearerToken

Inherits:
Object
  • Object
show all
Defined in:
lib/alloy/kyc/bearer_token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_token, expires_in) ⇒ BearerToken

Returns a new instance of BearerToken.



6
7
8
9
# File 'lib/alloy/kyc/bearer_token.rb', line 6

def initialize(access_token, expires_in)
  @token = access_token
  @expires_at = Time.now + expires_in
end

Instance Attribute Details

#expires_atObject

Returns the value of attribute expires_at.



4
5
6
# File 'lib/alloy/kyc/bearer_token.rb', line 4

def expires_at
  @expires_at
end

#tokenObject

Returns the value of attribute token.



4
5
6
# File 'lib/alloy/kyc/bearer_token.rb', line 4

def token
  @token
end

Instance Method Details

#expired?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/alloy/kyc/bearer_token.rb', line 11

def expired?
  Time.now > expires_at
end