Class: Yade::Common::Model::Authentication
- Inherits:
-
Object
- Object
- Yade::Common::Model::Authentication
- Includes:
- ActiveModel::Model, ActiveModel::Serializers::JSON, ActiveModel::Validations
- Defined in:
- lib/yade/common/model/authentication.rb
Overview
authentication
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#auth_password ⇒ Object
Returns the value of attribute auth_password.
-
#auth_url ⇒ Object
Returns the value of attribute auth_url.
-
#auth_username ⇒ Object
Returns the value of attribute auth_username.
-
#expiration_time ⇒ Object
Returns the value of attribute expiration_time.
-
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
Instance Method Summary collapse
- #attributes ⇒ Object
-
#read ⇒ Object
read.
-
#write ⇒ Object
write.
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
15 16 17 |
# File 'lib/yade/common/model/authentication.rb', line 15 def access_token @access_token end |
#auth_password ⇒ Object
Returns the value of attribute auth_password.
15 16 17 |
# File 'lib/yade/common/model/authentication.rb', line 15 def auth_password @auth_password end |
#auth_url ⇒ Object
Returns the value of attribute auth_url.
15 16 17 |
# File 'lib/yade/common/model/authentication.rb', line 15 def auth_url @auth_url end |
#auth_username ⇒ Object
Returns the value of attribute auth_username.
15 16 17 |
# File 'lib/yade/common/model/authentication.rb', line 15 def auth_username @auth_username end |
#expiration_time ⇒ Object
Returns the value of attribute expiration_time.
15 16 17 |
# File 'lib/yade/common/model/authentication.rb', line 15 def expiration_time @expiration_time end |
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
15 16 17 |
# File 'lib/yade/common/model/authentication.rb', line 15 def refresh_token @refresh_token end |
Instance Method Details
#attributes ⇒ Object
21 22 23 |
# File 'lib/yade/common/model/authentication.rb', line 21 def attributes instance_values end |
#read ⇒ Object
read
35 36 37 |
# File 'lib/yade/common/model/authentication.rb', line 35 def read from_json(File.read("#{ENV['HOME']}/.yade/authentication.json")) end |
#write ⇒ Object
write
26 27 28 29 30 31 32 |
# File 'lib/yade/common/model/authentication.rb', line 26 def write json = as_json.to_json File.open("#{ENV['HOME']}/.yade/authentication.json", 'w') do |f| f.write(json) end end |