Class: Clack::Prompts::Password
- Inherits:
-
Core::Prompt
- Object
- Core::Prompt
- Clack::Prompts::Password
- Defined in:
- lib/clack/prompts/password.rb
Overview
Password input prompt with masked display.
Displays a mask character for each input character, hiding the actual password. Supports backspace but not cursor movement (for security).
Constant Summary
Constants inherited from Core::Prompt
Core::Prompt::MIN_TERMINAL_WIDTH
Instance Attribute Summary
Attributes inherited from Core::Prompt
#error_message, #state, #value, #warning_message
Instance Method Summary collapse
-
#initialize(message:, mask: nil, **opts) ⇒ Password
constructor
A new instance of Password.
Methods inherited from Core::Prompt
flush_resize, register, #request_redraw, #run, setup_signal_handler, unregister
Constructor Details
#initialize(message:, mask: nil, **opts) ⇒ Password
Returns a new instance of Password.
21 22 23 24 25 |
# File 'lib/clack/prompts/password.rb', line 21 def initialize(message:, mask: nil, **opts) super(message:, **opts) @mask = mask || Symbols::S_PASSWORD_MASK @value = "" end |