Class: OmniAuth::GustoOauth2::TokenClient::TokenResult

Inherits:
Object
  • Object
show all
Defined in:
lib/omniauth/gusto_oauth2/token_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(success:, access_token: nil, refresh_token: nil, expires_at: nil, expires_in: nil, error: nil, raw_response: nil) ⇒ TokenResult



32
33
34
35
36
37
38
39
40
41
# File 'lib/omniauth/gusto_oauth2/token_client.rb', line 32

def initialize(success:, access_token: nil, refresh_token: nil, expires_at: nil, expires_in: nil,
               error: nil, raw_response: nil)
  @success = success
  @access_token = access_token
  @refresh_token = refresh_token
  @expires_at = expires_at
  @expires_in = expires_in
  @error = error
  @raw_response = raw_response
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



30
31
32
# File 'lib/omniauth/gusto_oauth2/token_client.rb', line 30

def access_token
  @access_token
end

#errorObject (readonly)

Returns the value of attribute error.



30
31
32
# File 'lib/omniauth/gusto_oauth2/token_client.rb', line 30

def error
  @error
end

#expires_atObject (readonly)

Returns the value of attribute expires_at.



30
31
32
# File 'lib/omniauth/gusto_oauth2/token_client.rb', line 30

def expires_at
  @expires_at
end

#expires_inObject (readonly)

Returns the value of attribute expires_in.



30
31
32
# File 'lib/omniauth/gusto_oauth2/token_client.rb', line 30

def expires_in
  @expires_in
end

#raw_responseObject (readonly)

Returns the value of attribute raw_response.



30
31
32
# File 'lib/omniauth/gusto_oauth2/token_client.rb', line 30

def raw_response
  @raw_response
end

#refresh_tokenObject (readonly)

Returns the value of attribute refresh_token.



30
31
32
# File 'lib/omniauth/gusto_oauth2/token_client.rb', line 30

def refresh_token
  @refresh_token
end

Instance Method Details

#failure?Boolean



47
48
49
# File 'lib/omniauth/gusto_oauth2/token_client.rb', line 47

def failure?
  !@success
end

#success?Boolean



43
44
45
# File 'lib/omniauth/gusto_oauth2/token_client.rb', line 43

def success?
  @success
end