Sha256: 23ecdf79e4f343ae887d1fa3bcb4dacc0b4fb78f466554cc7b33ca5a2d736217
Contents?: true
Size: 1.15 KB
Versions: 44
Compression:
Stored size: 1.15 KB
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 auto_value_entry.value end def auto_value_entry @auto_value_entry ||= ::Avm::Entries::AutoValues::Entry.new(parent, suffix) end # @return [Boolean] def context_found? context_entry.found? 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
44 entries across 44 versions & 2 rubygems