Class: StatelyDB::Common::Auth::TokenResult

Inherits:
Object
  • Object
show all
Defined in:
lib/common/auth/token_fetcher.rb

Overview

Result from a token fetch operation

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token:, expires_in_secs:) ⇒ TokenResult

Create a new TokenResult

Parameters:

  • token (String)

    The access token

  • expires_in_secs (Integer)

    The number of seconds until the token expires



24
25
26
27
# File 'lib/common/auth/token_fetcher.rb', line 24

def initialize(token:, expires_in_secs:)
  @token = token
  @expires_in_secs = expires_in_secs
end

Instance Attribute Details

#expires_in_secsInteger (readonly)

Returns The expiration time in seconds.

Returns:

  • (Integer)

    The expiration time in seconds.



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/common/auth/token_fetcher.rb', line 18

class TokenResult
  attr_reader :token, :expires_in_secs

  # Create a new TokenResult
  # @param [String] token The access token
  # @param [Integer] expires_in_secs The number of seconds until the token expires
  def initialize(token:, expires_in_secs:)
    @token = token
    @expires_in_secs = expires_in_secs
  end
end

#tokenString (readonly)

Returns The token string.

Returns:

  • (String)

    The token string.



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/common/auth/token_fetcher.rb', line 18

class TokenResult
  attr_reader :token, :expires_in_secs

  # Create a new TokenResult
  # @param [String] token The access token
  # @param [Integer] expires_in_secs The number of seconds until the token expires
  def initialize(token:, expires_in_secs:)
    @token = token
    @expires_in_secs = expires_in_secs
  end
end