Class: Toolshed::Password
- Inherits:
-
Object
- Object
- Toolshed::Password
- Defined in:
- lib/toolshed/password.rb
Instance Attribute Summary collapse
-
#password ⇒ Object
Returns the value of attribute password.
-
#sudo_password ⇒ Object
Returns the value of attribute sudo_password.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Password
constructor
A new instance of Password.
- #read_user_input_password(type, prompt_message = 'Password:') ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Password
Returns a new instance of Password.
5 6 7 8 |
# File 'lib/toolshed/password.rb', line 5 def initialize(={}) self.password = [:password] ||= '' self.sudo_password = [:sudo_password] ||= '' end |
Instance Attribute Details
#password ⇒ Object
Returns the value of attribute password.
3 4 5 |
# File 'lib/toolshed/password.rb', line 3 def password @password end |
#sudo_password ⇒ Object
Returns the value of attribute sudo_password.
3 4 5 |
# File 'lib/toolshed/password.rb', line 3 def sudo_password @sudo_password end |
Instance Method Details
#read_user_input_password(type, prompt_message = 'Password:') ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/toolshed/password.rb', line 10 def read_user_input_password(type, ='Password:') unless self.send(type).blank? read_password_from_configuration(type) else prompt_user_to_input_password() end end |