Sha256: ff7a0bea40932473683375829af69c11230ac147442d8e792866e4ef7733b0be
Contents?: true
Size: 1.21 KB
Versions: 40
Compression:
Stored size: 1.21 KB
Contents
# frozen_string_literal: true require 'eac_ruby_utils/core_ext' require 'avm/configs' require 'avm/instances/entry' module Avm module Instances module Entries def entry(suffix, options = {}) ::Avm::Instances::Entry.new(self, suffix, options) end def path_prefix @path_prefix ||= [id].freeze end def read_entry(entry_suffix, options = {}) entry(entry_suffix, options).value end def read_entry_optional(entry_suffix, options = {}) entry(entry_suffix, options).optional_value end def full_entry_path(entry_suffix) unless entry_suffix.is_a?(::Array) entry_suffix = ::EacRubyUtils::PathsHash.parse_entry_key(entry_suffix.to_s) end (path_prefix + entry_suffix).join('.') end def inherited_entry_value(source_entry_suffix, target_entry_suffix, &block) read_entry_optional(source_entry_suffix).if_present do |instance_id| other_entry_value(instance_id, target_entry_suffix).if_present(&block) end end def other_entry_value(instance_id, entry_suffix) ::Avm::Instances::Base.by_id(instance_id).read_entry_optional(entry_suffix) end end end end
Version data entries
40 entries across 40 versions & 1 rubygems