Class: Avm::Entries::Base::UriComponentsEntriesValues::UrlComponent

Inherits:
GenericComponent
  • Object
show all
Defined in:
lib/avm/entries/base/uri_components_entries_values/url_component.rb

Instance Method Summary collapse

Methods inherited from GenericComponent

#define_get_method, #define_get_optional_method, #define_inherited_value_proc_method, #entry_key_path, #id_component, #inherited_value_proc_name, #setup

Instance Method Details

#auto_install_url_by_parts(entries_provider) ⇒ Object



20
21
22
23
# File 'lib/avm/entries/base/uri_components_entries_values/url_component.rb', line 20

def auto_install_url_by_parts(entries_provider)
  require 'avm/entries/auto_values/uri_entry'
  ::Avm::Entries::AutoValues::UriEntry.new(entries_provider, 'install').value
end

#define_auto_methodObject



11
12
13
14
15
16
17
18
# File 'lib/avm/entries/base/uri_components_entries_values/url_component.rb', line 11

def define_auto_method
  outer_self = self
  entries_provider_class.define_method(auto_method_name) do
    inherited_entry_value(outer_self.id_component.entry_key_path.to_string,
                          outer_self.entry_key_path.to_string) ||
      outer_self.auto_install_url_by_parts(self)
  end
end