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.86.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.86.4 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.86.3 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.85.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.86.2 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.84.3 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.86.1 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.84.2 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.84.2 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.84.1 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.84.1 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.84.0 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.84.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.83.0 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.83.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.82.0 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.82.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.81.0 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
eac_tools-0.80.0 sub/avm/lib/avm/entries/base/uri_components_entries_values/component_factory.rb
avm-0.81.0 lib/avm/entries/base/uri_components_entries_values/component_factory.rb