Class: EacRubyUtils::Console::Configs

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_ruby_utils/console/configs.rb,
lib/eac_ruby_utils/console/configs/entry_reader.rb,
lib/eac_ruby_utils/console/configs/read_entry_options.rb,
lib/eac_ruby_utils/console/configs/password_entry_reader.rb,
lib/eac_ruby_utils/console/configs/store_passwords_entry_reader.rb

Defined Under Namespace

Classes: EntryReader, PasswordEntryReader, ReadEntryOptions, StorePasswordsEntryReader

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configs_key, options = {}) ⇒ Configs

Returns a new instance of Configs.



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

def initialize(configs_key, options = {})
  options.assert_argument(::Hash, 'options')
  @configs = ::EacRubyUtils::Configs.new(configs_key, options.merge(autosave: true))
end

Instance Attribute Details

#configsObject (readonly)

Returns the value of attribute configs.



18
19
20
# File 'lib/eac_ruby_utils/console/configs.rb', line 18

def configs
  @configs
end

Class Method Details

.entry_key_to_envvar_name(entry_key) ⇒ Object



13
14
15
# File 'lib/eac_ruby_utils/console/configs.rb', line 13

def entry_key_to_envvar_name(entry_key)
  ::EacRubyUtils::Console::Configs::EntryReader.entry_key_to_envvar_name(entry_key)
end

Instance Method Details

#read_entry(entry_key, options = {}) ⇒ Object



29
30
31
# File 'lib/eac_ruby_utils/console/configs.rb', line 29

def read_entry(entry_key, options = {})
  ::EacRubyUtils::Console::Configs::EntryReader.new(self, entry_key, options).read
end

#read_password(entry_key, options = {}) ⇒ Object



25
26
27
# File 'lib/eac_ruby_utils/console/configs.rb', line 25

def read_password(entry_key, options = {})
  ::EacRubyUtils::Console::Configs::PasswordEntryReader.new(self, entry_key, options).read
end

#store_passwords?Boolean

Returns:



33
34
35
# File 'lib/eac_ruby_utils/console/configs.rb', line 33

def store_passwords?
  ::EacRubyUtils::Console::Configs::StorePasswordsEntryReader.new(self) == 'yes'
end