Sha256: a6e87c17f26cdd2ef379ddb058985e19f787118134a1b96f4c51b915c6bfc2d2
Contents?: true
Size: 1.29 KB
Versions: 41
Compression:
Stored size: 1.29 KB
Contents
# frozen_string_literal: true require 'avm/entries/uri_builder' require 'eac_config/entry_path' require 'eac_ruby_utils/core_ext' module Avm module Entries module Base class InheritedEntryValue enable_method_class common_constructor :entries_provider, :source_entry_suffix, :target_entry_suffix, :block, block_arg: true def result self_entry_value.if_present do |instance_id| other_entry_value(instance_id).if_present(&block) end end # @param provider_id [String] # @return [Avm::Entries::Base] def other_entries_provider(provider_id) other_entries_provider_class.by_id(provider_id) end # @return [Class] def other_entries_provider_class [::Avm::Instances::Base, ::Avm::Applications::Base].each do |klass| return klass if entries_provider.is_a?(klass) end raise "No provider class found for \"#{entries_provider}\"" end def other_entry_value(instance_id) other_entries_provider(instance_id).read_entry_optional(target_entry_suffix) end def self_entry_value entries_provider.read_entry_optional(source_entry_suffix) end end end end end
Version data entries
41 entries across 41 versions & 2 rubygems