Class HammerCLIForeman::BasicCredentials
In: lib/hammer_cli_foreman/credentials.rb
Parent: ApipieBindings::AbstractCredentials

Methods

clear   empty?   new   password   to_params   username  

Public Class methods

Can keep username and passwords credentials and prompt for them when necessary @param [Hash] params @option params [String] :username when nil, user is prompted when the attribute is accessed @option params [String] :password when nil, user is prompted when the attribute is accessed @example use container with prompt

  c = HammerCLIForeman::BasicCredentials.new()
  c.username
  > [Foreman] Username: admin
  => "admin"

@example use container with preset value

  c = HammerCLIForeman::BasicCredentials.new(:username => 'admin')
  c.username
  => "admin"

Public Instance methods

Get password. Prompt for it when not set. Password characters are replaced with asterisks on the screen. @return [String]

Convert credentials to hash usable for merging to RestClient configuration. @return [Hash]

Get username. Prompt for it when not set @return [String]

[Validate]