Class: Octoauth::Auth
- Inherits:
-
Object
- Object
- Octoauth::Auth
- Defined in:
- lib/octoauth/auth.rb
Overview
Authentication object
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Auth
constructor
A new instance of Auth.
- #save ⇒ Object
- #token ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Auth
Returns a new instance of Auth.
22 23 24 25 |
# File 'lib/octoauth/auth.rb', line 22 def initialize(params = {}) parse_params!(params) save if @options[:autosave] end |
Instance Method Details
#save ⇒ Object
27 28 29 30 31 32 |
# File 'lib/octoauth/auth.rb', line 27 def save fail 'No token to save' unless token fail 'No file given for config' unless config.file config.token = token config.write end |
#token ⇒ Object
34 35 36 |
# File 'lib/octoauth/auth.rb', line 34 def token @token ||= load_token end |