Module: ROM::Configurable

Extended by:
Dry::Core::ClassAttributes
Included in:
ROM
Defined in:
lib/rom/support/configurable.rb,
lib/rom/support/configurable/dsl.rb,
lib/rom/support/configurable/flags.rb,
lib/rom/support/configurable/config.rb,
lib/rom/support/configurable/errors.rb,
lib/rom/support/configurable/methods.rb,
lib/rom/support/configurable/setting.rb,
lib/rom/support/configurable/version.rb,
lib/rom/support/configurable/compiler.rb,
lib/rom/support/configurable/settings.rb,
lib/rom/support/configurable/class_methods.rb,
lib/rom/support/configurable/instance_methods.rb

Overview

Shared errors

Defined Under Namespace

Modules: ClassMethods, ConfigMethods, Constructors, ExtensionMethods, Initializer, InstanceMethods, Methods Classes: Compiler, Config, DSL, Setting, Settings

Constant Summary collapse

Error =
Class.new(::StandardError)
AlreadyIncluded =
::Class.new(Error)
FrozenConfig =
::Class.new(Error)
VERSION =
"0.14.0"

Class Method Summary collapse

Class Method Details

.extended(klass) ⇒ Object

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.



40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/rom/support/configurable.rb', line 40

def self.extended(klass)
  super

  klass.extend(ClassMethods)
  klass.extend(ExtensionMethods)

  klass.class_eval do
    class << self
      # prepend(Methods)
      prepend(ExtensionMethods::DSL)
    end
  end
end

.included(klass) ⇒ Object

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.

Raises:



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rom/support/configurable.rb', line 18

def self.included(klass)
  raise AlreadyIncluded if klass.include?(InstanceMethods)

  super

  klass.extend(ClassMethods)
  klass.extend(ExtensionMethods)
  klass.include(InstanceMethods)
  klass.prepend(Initializer)

  klass.class_eval do
    class << self
      undef :config
      undef :configure

      # prepend(Methods)
      prepend(ExtensionMethods::DSL)
    end
  end
end