Sha256: 5efe1b9d41d33548ea603e2fafcee3c8ac493c5b070ce4b9f25ae13c6002b2a2

Contents?: true

Size: 971 Bytes

Versions: 161

Compression:

Stored size: 971 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'

module Avm
  module Entries
    module Base
      class UriComponentsEntriesValues
        class ComponentFactory
          enable_method_class
          common_constructor :owner, :component

          def result
            component_class.new(owner, component)
          end

          def component_class
            specific_class || generic_class
          end

          def generic_class
            parent_class.const_get('GenericComponent')
          end

          def parent_class
            ::Avm::Entries::Base::UriComponentsEntriesValues
          end

          def specific_class
            return nil unless parent_class.const_defined?(specific_class_basename)

            parent_class.const_get(specific_class_basename)
          end

          def specific_class_basename
            [component, 'component'].join('_').camelize
          end
        end
      end
    end
  end
end

Version data entries

161 entries across 161 versions & 2 rubygems

Version Path
avm-0.94.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.94.0 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.93.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.92.0 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.92.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.91.0 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.90.1 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.87.1 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.90.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.87.0 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.89.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.86.12 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.88.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.86.11 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.87.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.86.8 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.86.2 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.86.7 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.86.1 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.86.5 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb