Class: EacConfig::OldConfigs Deprecated

Inherits:
Object
  • Object
show all
Includes:
EacRubyUtils::SimpleCache
Defined in:
lib/eac_config/old_configs.rb,
lib/eac_config/old_configs/base.rb,
lib/eac_config/old_configs/file.rb

Overview

Deprecated.

Use YamlFileNode instead.

Defined Under Namespace

Classes: Base, File

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Valid options: [:storage_path]



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

def initialize(configs_key, options = {})
  @configs_key = configs_key
  @options = options.to_sym_keys_hash.freeze
  load
end

Instance Attribute Details

#configs_keyObject (readonly)

Returns the value of attribute configs_key.



15
16
17
# File 'lib/eac_config/old_configs.rb', line 15

def configs_key
  @configs_key
end

#optionsObject (readonly)

Returns the value of attribute options.



15
16
17
# File 'lib/eac_config/old_configs.rb', line 15

def options
  @options
end

Instance Method Details

#[](entry_key) ⇒ Object



38
39
40
# File 'lib/eac_config/old_configs.rb', line 38

def [](entry_key)
  read_entry(entry_key)
end

#[]=(entry_key, entry_value) ⇒ Object



30
31
32
# File 'lib/eac_config/old_configs.rb', line 30

def []=(entry_key, entry_value)
  write_entry(entry_key, entry_value)
end

#read_entry(entry_key) ⇒ Object



42
43
44
# File 'lib/eac_config/old_configs.rb', line 42

def read_entry(entry_key)
  file.read(entry_key)
end

#write_entry(entry_key, entry_value) ⇒ Object



34
35
36
# File 'lib/eac_config/old_configs.rb', line 34

def write_entry(entry_key, entry_value)
  file.write(entry_key, entry_value)
end