Class: ROM::Setup

Inherits:
Object
  • Object
show all
Defined in:
core/lib/rom/setup.rb

Overview

Setup objects collect component classes during setup/finalization process

Instance Method Summary collapse

Instance Method Details

#auto_registration(directory, **options) ⇒ Setup

Enable auto-registration for a given setup object

Parameters:

  • directory (String, Pathname)

    The root path to components

  • options (Hash)

Options Hash (**options):

  • :namespace (Boolean, String)

    Enable/disable namespace or provide a custom namespace name

Returns:



49
50
51
52
53
54
55
# File 'core/lib/rom/setup.rb', line 49

def auto_registration(directory, **options)
  auto_registration = AutoRegistration.new(directory, **options)
  auto_registration.relations.map { |r| register_relation(r) }
  auto_registration.commands.map { |r| register_command(r) }
  auto_registration.mappers.map { |r| register_mapper(r) }
  self
end