Class: Avm::Entries::Base::UriComponentsEntriesValues::ComponentFactory
- Inherits:
-
Object
- Object
- Avm::Entries::Base::UriComponentsEntriesValues::ComponentFactory
- Defined in:
- lib/avm/entries/base/uri_components_entries_values/component_factory.rb
Instance Method Summary collapse
- #component_class ⇒ Object
- #generic_class ⇒ Object
- #parent_class ⇒ Object
- #result ⇒ Object
- #specific_class ⇒ Object
- #specific_class_basename ⇒ Object
Instance Method Details
#component_class ⇒ Object
17 18 19 |
# File 'lib/avm/entries/base/uri_components_entries_values/component_factory.rb', line 17 def component_class specific_class || generic_class end |
#generic_class ⇒ Object
21 22 23 |
# File 'lib/avm/entries/base/uri_components_entries_values/component_factory.rb', line 21 def generic_class parent_class.const_get('GenericComponent') end |
#parent_class ⇒ Object
25 26 27 |
# File 'lib/avm/entries/base/uri_components_entries_values/component_factory.rb', line 25 def parent_class ::Avm::Entries::Base::UriComponentsEntriesValues end |
#result ⇒ Object
13 14 15 |
# File 'lib/avm/entries/base/uri_components_entries_values/component_factory.rb', line 13 def result component_class.new(owner, component) end |
#specific_class ⇒ Object
29 30 31 32 33 |
# File 'lib/avm/entries/base/uri_components_entries_values/component_factory.rb', line 29 def specific_class return nil unless parent_class.const_defined?(specific_class_basename) parent_class.const_get(specific_class_basename) end |
#specific_class_basename ⇒ Object
35 36 37 |
# File 'lib/avm/entries/base/uri_components_entries_values/component_factory.rb', line 35 def specific_class_basename [component, 'component'].join('_').camelize end |