Module: Avm::Entries::Base

Included in:
Applications::Base, Instances::Base
Defined in:
lib/avm/entries/base.rb,
lib/avm/entries/base/inherited_entry_value.rb,
lib/avm/entries/base/uri_component_entry_value.rb,
lib/avm/entries/base/uri_components_entries_values.rb,
lib/avm/entries/base/uri_component_entry_value/default_value.rb,
lib/avm/entries/base/uri_component_entry_value/inherited_value.rb,
lib/avm/entries/base/uri_component_entry_value/url_entry_value.rb,
lib/avm/entries/base/uri_components_entries_values/url_component.rb,
lib/avm/entries/base/uri_components_entries_values/path_component.rb,
lib/avm/entries/base/uri_components_entries_values/component_factory.rb,
lib/avm/entries/base/uri_components_entries_values/generic_component.rb

Defined Under Namespace

Modules: ClassMethods Classes: InheritedEntryValue, UriComponentEntryValue, UriComponentsEntriesValues

Instance Method Summary collapse

Instance Method Details

#entries_provider_idObject



19
20
21
# File 'lib/avm/entries/base.rb', line 19

def entries_provider_id
  id
end

#entries_provider_id!void

This method returns an undefined value.

Raises:



25
26
27
28
29
30
31
# File 'lib/avm/entries/base.rb', line 25

def entries_provider_id!
  return entries_provider_id unless
  entries_provider_id.include?(::EacConfig::EntryPath::PART_SEPARATOR)

  raise ".entries_provider_id \"#{entries_provider_id}\" cannot have " \
        "\"#{::EacConfig::EntryPath::PART_SEPARATOR}\" (EacConfig::EntryPath::PART_SEPARATOR)"
end

#entry(suffix, options = {}) ⇒ Object



33
34
35
# File 'lib/avm/entries/base.rb', line 33

def entry(suffix, options = {})
  ::Avm::Entries::Entry.new(self, suffix, options)
end

#full_entry_path(entry_suffix) ⇒ Object



49
50
51
52
53
54
# File 'lib/avm/entries/base.rb', line 49

def full_entry_path(entry_suffix)
  unless entry_suffix.is_a?(::Array)
    entry_suffix = ::EacConfig::PathsHash.parse_entry_key(entry_suffix.to_s)
  end
  (path_prefix + entry_suffix).join('.')
end

#path_prefixObject



37
38
39
# File 'lib/avm/entries/base.rb', line 37

def path_prefix
  @path_prefix ||= [entries_provider_id!].freeze
end

#read_entry(entry_suffix, options = {}) ⇒ Object



41
42
43
# File 'lib/avm/entries/base.rb', line 41

def read_entry(entry_suffix, options = {})
  entry(entry_suffix, options).value
end

#read_entry_optional(entry_suffix, options = {}) ⇒ Object



45
46
47
# File 'lib/avm/entries/base.rb', line 45

def read_entry_optional(entry_suffix, options = {})
  entry(entry_suffix, options).optional_value
end