Class: Stealth::Migrations::InternalConfigurationsProxy

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configurations) ⇒ InternalConfigurationsProxy

Returns a new instance of InternalConfigurationsProxy.



10
11
12
# File 'lib/stealth/migrations/configurator.rb', line 10

def initialize(configurations)
  @configurations = configurations
end

Instance Attribute Details

#configurationsObject (readonly)

Returns the value of attribute configurations.



8
9
10
# File 'lib/stealth/migrations/configurator.rb', line 8

def configurations
  @configurations
end

Instance Method Details

#on(config_key) ⇒ Object



14
15
16
17
18
19
# File 'lib/stealth/migrations/configurator.rb', line 14

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