class EacRubyUtils::PathsHash
def [](entry_key)
def [](entry_key) root.read_entry(self.class.parse_entry_key(entry_key), []) end
def []=(entry_key, entry_value)
def []=(entry_key, entry_value) root.write_entry(self.class.parse_entry_key(entry_key), entry_value, []) end
def initialize(source_hash = {})
def initialize(source_hash = {}) @root = Node.new(source_hash) end
def parse_entry_key(entry_key)
def parse_entry_key(entry_key) r = entry_key.to_s.strip raise EntryKeyError, 'Entry key cannot start or end with dot' if r.start_with?('.') || r.end_with?('.') r = r.split('.').map(&:strip) raise EntryKeyError, "Entry key \"#{entry_key}\" is empty" if r.empty? return r.map(&:to_sym) unless r.any?(&:blank?) raise EntryKeyError, "Entry key \"#{entry_key}\" has at least one blank part" end