Class: ROM::AutoRegistrationStrategies::NoNamespace Private

Inherits:
Base
  • Object
show all
Defined in:
core/lib/rom/setup/auto_registration_strategies/no_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.

NoNamespace strategy assumes components are not defined within a namespace

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 'core/lib/rom/setup/auto_registration_strategies/no_namespace.rb', line 17

option :directory, type: PathnameType

#entitySymbol (readonly)

Returns Component identifier.

Returns:

  • (Symbol)

    Component identifier



21
# File 'core/lib/rom/setup/auto_registration_strategies/no_namespace.rb', line 21

option :entity, type: Types::Strict::Symbol

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



26
27
28
29
30
# File 'core/lib/rom/setup/auto_registration_strategies/no_namespace.rb', line 26

def call
  Inflector.camelize(
    file.sub(%r{^#{directory}/#{entity}/}, '').sub(EXTENSION_REGEX, '')
  )
end