Class: Pickpocket::Authentication::TokenHandler
- Inherits:
-
Object
- Object
- Pickpocket::Authentication::TokenHandler
- Defined in:
- lib/pickpocket/authentication/token_handler.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize ⇒ TokenHandler
constructor
A new instance of TokenHandler.
- #read_auth ⇒ Object
- #read_oauth ⇒ Object
- #save_auth(token) ⇒ Object
- #save_oauth(token) ⇒ Object
Constructor Details
#initialize ⇒ TokenHandler
Returns a new instance of TokenHandler.
6 7 8 |
# File 'lib/pickpocket/authentication/token_handler.rb', line 6 def initialize @logger = Pickpocket::Logger end |
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
4 5 6 |
# File 'lib/pickpocket/authentication/token_handler.rb', line 4 def logger @logger end |
Instance Method Details
#read_auth ⇒ Object
22 23 24 |
# File 'lib/pickpocket/authentication/token_handler.rb', line 22 def read_auth read_token(path: Pickpocket.config., error_message: 'Authorization Token file does not exist. Make sure you request authorization before proceeding.') end |
#read_oauth ⇒ Object
18 19 20 |
# File 'lib/pickpocket/authentication/token_handler.rb', line 18 def read_oauth read_token(path: Pickpocket.config.oauth_token_file, error_message: 'OAuth Token file does not exist. Make sure you request authorization before proceeding.') end |
#save_auth(token) ⇒ Object
14 15 16 |
# File 'lib/pickpocket/authentication/token_handler.rb', line 14 def save_auth(token) save_token(token: token, path: Pickpocket.config.) end |
#save_oauth(token) ⇒ Object
10 11 12 |
# File 'lib/pickpocket/authentication/token_handler.rb', line 10 def save_oauth(token) save_token(token: token, path: Pickpocket.config.oauth_token_file) end |