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.



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

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

Instance Method Details

#authorization_headerObject



33
34
35
# File 'lib/cli/client/credentials.rb', line 33

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

#refreshObject



37
38
39
# File 'lib/cli/client/credentials.rb', line 37

def refresh
  false
end

#usernameObject



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

def username
  @username
end