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
20 21 22 |
# File 'lib/eac_config/old_configs/base.rb', line 20 def [](entry_key) read(entry_key) end |
#[]=(entry_key, entry_value) ⇒ Object
16 17 18 |
# File 'lib/eac_config/old_configs/base.rb', line 16 def []=(entry_key, entry_value) write(entry_key, entry_value) end |
#clear ⇒ Object
24 25 26 |
# File 'lib/eac_config/old_configs/base.rb', line 24 def clear replace({}) end |
#read(entry_key) ⇒ Object
28 29 30 31 32 |
# File 'lib/eac_config/old_configs/base.rb', line 28 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
34 35 36 |
# File 'lib/eac_config/old_configs/base.rb', line 34 def replace(new_data) self.data = ::EacConfig::PathsHash.new(new_data) end |
#write(entry_key, entry_value) ⇒ Object
38 39 40 |
# File 'lib/eac_config/old_configs/base.rb', line 38 def write(entry_key, entry_value) data[entry_key] = entry_value end |