Class: Avm::Entries::Base::UriComponentsEntriesValues::GenericComponent

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

Direct Known Subclasses

PathComponent, UrlComponent

Instance Method Summary collapse

Instance Method Details

#auto_method_nameObject



14
15
16
# File 'lib/avm/entries/base/uri_components_entries_values/generic_component.rb', line 14

def auto_method_name
  ['auto', component_method_name].join('_')
end

#component_method_nameObject



18
19
20
# File 'lib/avm/entries/base/uri_components_entries_values/generic_component.rb', line 18

def component_method_name
  [prefix, component].join('_')
end

#define_auto_method(&block) ⇒ Object



22
23
24
# File 'lib/avm/entries/base/uri_components_entries_values/generic_component.rb', line 22

def define_auto_method(&block)
  entries_provider_class.define_method(auto_method_name, &block)
end

#define_inherited_value_proc_method(&block) ⇒ Object



26
27
28
# File 'lib/avm/entries/base/uri_components_entries_values/generic_component.rb', line 26

def define_inherited_value_proc_method(&block)
  entries_provider_class.define_method(inherited_value_proc_name, &block)
end

#entry_key_pathObject



30
31
32
# File 'lib/avm/entries/base/uri_components_entries_values/generic_component.rb', line 30

def entry_key_path
  ::EacConfig::EntryPath.assert([prefix, component])
end

#id_componentObject



34
35
36
# File 'lib/avm/entries/base/uri_components_entries_values/generic_component.rb', line 34

def id_component
  @id_component ||= owner.component_factory('id')
end

#inherited_value_proc_nameObject



38
39
40
# File 'lib/avm/entries/base/uri_components_entries_values/generic_component.rb', line 38

def inherited_value_proc_name
  [component_method_name, 'inherited_value_proc'].join('_')
end

#setupObject



42
43
44
45
46
47
# File 'lib/avm/entries/base/uri_components_entries_values/generic_component.rb', line 42

def setup
  outer_self = self
  define_auto_method do
    uri_component_entry_value(outer_self.entry_key_path.to_string)
  end
end