Module: ROM::Configurable::Methods

Included in:
ClassMethods, InstanceMethods
Defined in:
lib/rom/support/configurable/methods.rb

Overview

Common API for both classes and instances

Instance Method Summary collapse

Instance Method Details

#configure {|config| ... } ⇒ Object

Yields:

  • (config)

Raises:



12
13
14
15
16
17
# File 'lib/rom/support/configurable/methods.rb', line 12

def configure(&block)
  raise FrozenConfig, "Cannot modify frozen config" if frozen?

  yield(config) if block
  self
end

#finalize!ROM::Configurable::Config

Finalize and freeze configuration



24
25
26
27
28
29
# File 'lib/rom/support/configurable/methods.rb', line 24

def finalize!
  return self if config.frozen?

  config.finalize!
  self
end