Class: StandaloneMigrations::InternalConfigurationsProxy
- Inherits:
-
Object
- Object
- StandaloneMigrations::InternalConfigurationsProxy
- Defined in:
- lib/standalone_migrations/configurator.rb
Instance Attribute Summary collapse
-
#configurations ⇒ Object
readonly
Returns the value of attribute configurations.
Instance Method Summary collapse
-
#initialize(configurations) ⇒ InternalConfigurationsProxy
constructor
A new instance of InternalConfigurationsProxy.
- #on(config_key) ⇒ Object
Constructor Details
#initialize(configurations) ⇒ InternalConfigurationsProxy
Returns a new instance of InternalConfigurationsProxy.
8 9 10 |
# File 'lib/standalone_migrations/configurator.rb', line 8 def initialize(configurations) @configurations = configurations end |
Instance Attribute Details
#configurations ⇒ Object (readonly)
Returns the value of attribute configurations.
7 8 9 |
# File 'lib/standalone_migrations/configurator.rb', line 7 def configurations @configurations end |
Instance Method Details
#on(config_key) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/standalone_migrations/configurator.rb', line 12 def on(config_key) if @configurations[config_key] && block_given? @configurations[config_key] = yield(@configurations[config_key]) || @configurations[config_key] end @configurations[config_key] end |