Class: StandaloneMigrations::InternalConfigurationsProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/standalone_migrations/configurator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#configurationsObject (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