Class: EacRubyUtils::Console::Configs::StorePasswordsEntryReader

Inherits:
EntryReader show all
Defined in:
lib/eac_ruby_utils/console/configs/store_passwords_entry_reader.rb

Constant Summary collapse

ENTRY_KEY =
'core.store_passwords'

Instance Method Summary collapse

Methods inherited from EntryReader

entry_key_to_envvar_name, #read, #read_from_console, #read_from_envvars, #read_from_storage

Constructor Details

#initialize(console_configs) ⇒ StorePasswordsEntryReader

Returns a new instance of StorePasswordsEntryReader.



11
12
13
14
15
16
# File 'lib/eac_ruby_utils/console/configs/store_passwords_entry_reader.rb', line 11

def initialize(console_configs)
  super(console_configs, ENTRY_KEY,
    before_input: -> { banner },
    validator: ->(entry_value) { %w[yes no].include?(entry_value) }
  )
end

Instance Method Details



18
19
20
21
22
23
# File 'lib/eac_ruby_utils/console/configs/store_passwords_entry_reader.rb', line 18

def banner
  infom 'Do you wanna to store passwords?'
  infom 'Warning: the passwords will be store in clear text in ' \
    "\"#{console_configs.configs.storage_path}\""
  infom 'Enter "yes" or "no"'
end