Class: EacConfig::OldConfigs::Base
- Inherits:
-
Object
- Object
- EacConfig::OldConfigs::Base
- Defined in:
- lib/eac_config/old_configs/base.rb
Direct Known Subclasses
Instance Method Summary collapse
- #[](entry_key) ⇒ Object
- #[]=(entry_key, entry_value) ⇒ Object
- #clear ⇒ Object
- #read(entry_key) ⇒ Object
- #replace(new_data) ⇒ Object
- #write(entry_key, entry_value) ⇒ Object
Instance Method Details
#[](entry_key) ⇒ Object
19 20 21 |
# File 'lib/eac_config/old_configs/base.rb', line 19 def [](entry_key) read(entry_key) end |
#[]=(entry_key, entry_value) ⇒ Object
15 16 17 |
# File 'lib/eac_config/old_configs/base.rb', line 15 def []=(entry_key, entry_value) write(entry_key, entry_value) end |
#clear ⇒ Object
23 24 25 |
# File 'lib/eac_config/old_configs/base.rb', line 23 def clear replace({}) end |
#read(entry_key) ⇒ Object
27 28 29 30 31 |
# File 'lib/eac_config/old_configs/base.rb', line 27 def read(entry_key) return nil unless data.key?(entry_key) data.fetch(entry_key).if_present(::EacRubyUtils::BlankNotBlank.instance) end |
#replace(new_data) ⇒ Object
33 34 35 |
# File 'lib/eac_config/old_configs/base.rb', line 33 def replace(new_data) self.data = ::EacConfig::PathsHash.new(new_data) end |
#write(entry_key, entry_value) ⇒ Object
37 38 39 |
# File 'lib/eac_config/old_configs/base.rb', line 37 def write(entry_key, entry_value) data[entry_key] = entry_value end |