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

#define_auto_methodObject



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

def define_auto_method
  outer_self = self
  entries_provider_class.define_method(auto_method_name) do
    uri_component_entry_value(outer_self.entry_key_path.to_string)
  end
end

#define_get_methodObject



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

def define_get_method
  outer_self = self
  entries_provider_class.define_method(get_method_name) do
    read_entry(outer_self.entry_key_path.to_string)
  end
end

#define_get_optional_methodObject



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

def define_get_optional_method
  outer_self = self
  entries_provider_class.define_method(get_optional_method_name) do
    read_entry_optional(outer_self.entry_key_path.to_string)
  end
end

#define_inherited_value_proc_method(&block) ⇒ Object



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

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

#entry_key_pathObject



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

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

#id_componentObject



46
47
48
# File 'lib/avm/entries/base/uri_components_entries_values/generic_component.rb', line 46

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

#inherited_value_proc_nameObject



50
51
52
# File 'lib/avm/entries/base/uri_components_entries_values/generic_component.rb', line 50

def inherited_value_proc_name
  entry_key_path.inherited_block_method_name
end

#setupObject



54
55
56
57
58
# File 'lib/avm/entries/base/uri_components_entries_values/generic_component.rb', line 54

def setup
  define_auto_method
  define_get_method
  define_get_optional_method
end