Class: EacCli::OldConfigs

Inherits:
Object show all
Defined in:
lib/eac_cli/old_configs.rb,
lib/eac_cli/old_configs/entry_reader.rb,
lib/eac_cli/old_configs/read_entry_options.rb,
lib/eac_cli/old_configs/password_entry_reader.rb,
lib/eac_cli/old_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 = {}) ⇒ OldConfigs

Returns a new instance of OldConfigs.



18
19
20
21
# File 'lib/eac_cli/old_configs.rb', line 18

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

Instance Attribute Details

#configsObject (readonly)

Returns the value of attribute configs.



16
17
18
# File 'lib/eac_cli/old_configs.rb', line 16

def configs
  @configs
end

Class Method Details

.entry_key_to_envvar_name(entry_key) ⇒ Object



11
12
13
# File 'lib/eac_cli/old_configs.rb', line 11

def entry_key_to_envvar_name(entry_key)
  ::EacCli::OldConfigs::EntryReader.entry_key_to_envvar_name(entry_key)
end

Instance Method Details

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



27
28
29
# File 'lib/eac_cli/old_configs.rb', line 27

def read_entry(entry_key, options = {})
  ::EacCli::OldConfigs::EntryReader.new(self, entry_key, options).read
end

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



23
24
25
# File 'lib/eac_cli/old_configs.rb', line 23

def read_password(entry_key, options = {})
  ::EacCli::OldConfigs::PasswordEntryReader.new(self, entry_key, options).read
end

#store_passwords?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/eac_cli/old_configs.rb', line 31

def store_passwords?
  ::EacCli::OldConfigs::StorePasswordsEntryReader.new(self) == 'yes'
end