Class: Refinery::SettingsInitializer::Loader
- Inherits:
-
Object
- Object
- Refinery::SettingsInitializer::Loader
- Defined in:
- lib/refinery/settings_initializer/loader.rb
Instance Attribute Summary collapse
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Instance Method Summary collapse
-
#initialize(settings) ⇒ Loader
constructor
A new instance of Loader.
- #load ⇒ Object
Constructor Details
#initialize(settings) ⇒ Loader
Returns a new instance of Loader.
6 7 8 |
# File 'lib/refinery/settings_initializer/loader.rb', line 6 def initialize(settings) @settings = settings end |
Instance Attribute Details
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
4 5 6 |
# File 'lib/refinery/settings_initializer/loader.rb', line 4 def settings @settings end |
Instance Method Details
#load ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/refinery/settings_initializer/loader.rb', line 10 def load settings.map do |scope, children| children.map do |name, value| [name, transform_value(value, scope)] end end.flatten(1).each do |name, | RefinerySetting.set(name, ) end end |