Class: Reposit::CredentialsReader
- Inherits:
-
Object
- Object
- Reposit::CredentialsReader
- Defined in:
- lib/reposit.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #get_credentials ⇒ Object
-
#initialize ⇒ CredentialsReader
constructor
A new instance of CredentialsReader.
Constructor Details
#initialize ⇒ CredentialsReader
Returns a new instance of CredentialsReader.
92 93 94 |
# File 'lib/reposit.rb', line 92 def initialize @username, @api_key = get_credentials end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
90 91 92 |
# File 'lib/reposit.rb', line 90 def api_key @api_key end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
90 91 92 |
# File 'lib/reposit.rb', line 90 def username @username end |
Instance Method Details
#get_credentials ⇒ Object
96 97 98 99 100 |
# File 'lib/reposit.rb', line 96 def get_credentials File.readlines(File.('~') + '/.reposit').map do |credential| credential.strip end end |