Class: Token

Inherits:
Object
  • Object
show all
Includes:
Constants
Defined in:
lib/ft_42.rb

Constant Summary

Constants included from Constants

Constants::HOURS_ACHIEVEMENT, Constants::HOURS_CHALLENGE, Constants::HOURS_NEEDED, Constants::SECRET_42, Constants::UID_42, Constants::URL_42

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeToken

Returns a new instance of Token.



169
170
171
172
# File 'lib/ft_42.rb', line 169

def initialize
  client = OAuth2::Client.new(UID_42, SECRET_42, site: URL_42)
  @token = client.client_credentials.get_token
end

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token.



167
168
169
# File 'lib/ft_42.rb', line 167

def token
  @token
end