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
eac_tools-0.69.1 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.75.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.69.0 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.74.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.68.0 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.73.1 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.67.1 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.73.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.67.0 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.72.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.66.0 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.65.1 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.71.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.65.0 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.70.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.64.0 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.69.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.63.0 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.62.1 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.68.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb