Class: Qc::Credentials
- Inherits:
-
Struct
- Object
- Struct
- Qc::Credentials
- Defined in:
- lib/qc/credentials.rb
Constant Summary collapse
- FILE_NAME =
'credentials.yml'
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token
2 3 4 |
# File 'lib/qc/credentials.rb', line 2 def access_token @access_token end |
#user_id ⇒ Object
Returns the value of attribute user_id
2 3 4 |
# File 'lib/qc/credentials.rb', line 2 def user_id @user_id end |
Class Method Details
.credentials_file ⇒ Object
21 22 23 |
# File 'lib/qc/credentials.rb', line 21 def self.credentials_file ::File.join(Qc::Util.home_dir, FILE_NAME) end |
.read_from_home ⇒ Object
5 6 7 8 |
# File 'lib/qc/credentials.rb', line 5 def self.read_from_home return nil unless ::File.exists?(credentials_file) YAML.load_file credentials_file end |
Instance Method Details
#destroy ⇒ Object
17 18 19 |
# File 'lib/qc/credentials.rb', line 17 def destroy FileUtils.remove(self.class.credentials_file) end |