Sha256: b8ad398fa72380e1c72d6c895f45dfa9c5069fa7e5d65ece275f7b5b32a6935c
Contents?: true
Size: 901 Bytes
Versions: 69
Compression:
Stored size: 901 Bytes
Contents
# frozen_string_literal: true require 'eac_ruby_utils/blank_not_blank' require 'eac_ruby_utils/core_ext' require 'eac_ruby_utils/paths_hash' module EacRubyUtils class Configs class Base enable_simple_cache common_constructor :data, default: [{}] do self.data = ::EacRubyUtils::PathsHash.new(data) end def []=(entry_key, entry_value) write(entry_key, entry_value) end def [](entry_key) read(entry_key) end def clear replace({}) end def read(entry_key) return nil unless data.key?(entry_key) data.fetch(entry_key).if_present(::EacRubyUtils::BlankNotBlank.instance) end def replace(new_data) self.data = ::EacRubyUtils::PathsHash.new(new_data) end def write(entry_key, entry_value) data[entry_key] = entry_value end end end end
Version data entries
69 entries across 69 versions & 3 rubygems