Class: Bosh::Cli::Client::BasicCredentials

Inherits:
Object
  • Object
show all
Defined in:
lib/cli/client/credentials.rb

Instance Method Summary collapse

Constructor Details

#initialize(username, password) ⇒ BasicCredentials

Returns a new instance of BasicCredentials.



19
20
21
22
# File 'lib/cli/client/credentials.rb', line 19

def initialize(username, password)
  @username = username
  @password = password
end

Instance Method Details

#authorization_headerObject



28
29
30
# File 'lib/cli/client/credentials.rb', line 28

def authorization_header
  'Basic ' + Base64.encode64("#{@username}:#{@password}").strip
end

#usernameObject



24
25
26
# File 'lib/cli/client/credentials.rb', line 24

def username
  @username
end