Class: ROM::AutoRegistrationStrategies::WithNamespace Private

Inherits:
Base
  • Object
show all
Defined in:
lib/rom/compat/auto_registration_strategies/with_namespace.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

WithNamespace strategy assumes components are defined within a namespace that matches top-level directory name.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#directoryPathname (readonly)

Returns The path to dir with components.

Returns:

  • (Pathname)

    The path to dir with components



17
# File 'lib/rom/compat/auto_registration_strategies/with_namespace.rb', line 17

option :directory, type: PathnameType

Instance Method Details

#callObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Load components



22
23
24
25
26
# File 'lib/rom/compat/auto_registration_strategies/with_namespace.rb', line 22

def call
  inflector.camelize(
    file.sub(%r{^#{directory.dirname}/}, "").sub(EXTENSION_REGEX, "")
  )
end