Class: Avm::Entries::Base::InheritedEntryValue
- Inherits:
-
Object
- Object
- Avm::Entries::Base::InheritedEntryValue
- Defined in:
- lib/avm/entries/base/inherited_entry_value.rb
Instance Method Summary collapse
- #other_entries_provider(provider_id) ⇒ Avm::Entries::Base
- #other_entries_provider_class ⇒ Class
- #other_entry_value(instance_id) ⇒ Object
- #result ⇒ Object
- #self_entry_value ⇒ Object
Instance Method Details
#other_entries_provider(provider_id) ⇒ Avm::Entries::Base
23 24 25 |
# File 'lib/avm/entries/base/inherited_entry_value.rb', line 23 def other_entries_provider(provider_id) other_entries_provider_class.by_id(provider_id) end |
#other_entries_provider_class ⇒ Class
28 29 30 31 32 33 34 |
# File 'lib/avm/entries/base/inherited_entry_value.rb', line 28 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 |
#other_entry_value(instance_id) ⇒ Object
36 37 38 |
# File 'lib/avm/entries/base/inherited_entry_value.rb', line 36 def other_entry_value(instance_id) other_entries_provider(instance_id).read_entry_optional(target_entry_suffix) end |
#result ⇒ Object
15 16 17 18 19 |
# File 'lib/avm/entries/base/inherited_entry_value.rb', line 15 def result self_entry_value.if_present do |instance_id| other_entry_value(instance_id).if_present(&block) end end |
#self_entry_value ⇒ Object
40 41 42 |
# File 'lib/avm/entries/base/inherited_entry_value.rb', line 40 def self_entry_value entries_provider.read_entry_optional(source_entry_suffix) end |