Class: Reposit::CredentialsReader

Inherits:
Object
  • Object
show all
Defined in:
lib/reposit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCredentialsReader

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_keyObject (readonly)

Returns the value of attribute api_key.



90
91
92
# File 'lib/reposit.rb', line 90

def api_key
  @api_key
end

#usernameObject (readonly)

Returns the value of attribute username.



90
91
92
# File 'lib/reposit.rb', line 90

def username
  @username
end

Instance Method Details

#get_credentialsObject



96
97
98
99
100
# File 'lib/reposit.rb', line 96

def get_credentials
  File.readlines(File.expand_path('~') + '/.reposit').map do |credential|
    credential.strip
  end
end