Sha256: 90c921a57847b6fcfe1d3ec8ed181cb58fb58d778bf763288a9c7b448f53daa4
Contents?: true
Size: 1003 Bytes
Versions: 17
Compression:
Stored size: 1003 Bytes
Contents
# frozen_string_literal: true require 'avm/entries/auto_values/entry' require 'eac_config/node' require 'eac_ruby_utils/core_ext' module Avm module Entries class Entry common_constructor :parent, :suffix, :options def auto_value ::Avm::Entries::AutoValues::Entry.new(parent, suffix).value end def full_path (parent.path_prefix + suffix_as_array).join('.') end def optional_value context_entry.found? ? context_entry.value : auto_value end def read context_entry.value end def suffix_as_array if suffix.is_a?(::Array) suffix.dup else ::EacConfig::PathsHash.parse_entry_key(suffix.to_s) end end def value optional_value || read end def write(value) context_entry.value = value end private def context_entry ::EacConfig::Node.context.current.entry(full_path) end end end end
Version data entries
17 entries across 17 versions & 2 rubygems