Module: ROM::Configurable::ExtensionMethods::DSL Private

Included in:
DSL
Defined in:
lib/rom/support/configurable.rb

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

Instance Method Summary collapse

Instance Method Details

#setting(name, import: nil, inherit: false, join: false, default: Undefined, **options) ⇒ 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.



194
195
196
197
198
199
200
201
202
203
204
# File 'lib/rom/support/configurable.rb', line 194

def setting(name, import: nil, inherit: false, join: false, default: Undefined, **options)
  if import
    setting_import(name, import, **options)
  elsif inherit
    setting(name, default: default, constructor: Constructors::Inherit.new(name), **options)
  elsif join
    setting(name, default: default, constructor: Constructors::Join.new(name), **options)
  else
    super(name, default: default, **options)
  end
end

#setting_import(name, setting) ⇒ 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.



207
208
209
210
211
212
# File 'lib/rom/support/configurable.rb', line 207

def setting_import(name, setting)
  # TODO: it would be great if this could just be import.with(name: name)
  settings << setting.class.new(
    name, input: setting.input, default: setting.default, **setting.options
  )
end

#settingsObject

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.



215
216
217
# File 'lib/rom/support/configurable.rb', line 215

def settings
  _settings
end