Class: Mordor::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/mordor/config.rb

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object

Retrieve the value of a config entry.

Parameters

key<Object>

The key to retrieve the parameter for.

Returns

Object

The value of the configuration parameter.

:api: public



35
36
37
# File 'lib/mordor/config.rb', line 35

def [](key)
  (@configuration ||= setup)[key]
end

.[]=(key, val) ⇒ Object

Set the value of a config entry.

Parameters

key<Object>

The key to set the parameter for.

val<Object>

The value of the parameter.

:api: public



46
47
48
# File 'lib/mordor/config.rb', line 46

def []=(key, val)
  (@configuration ||= setup)[key] = val
end

.use {|@configuration| ... } ⇒ Object

Yields the configuration.

Block parameters

c<Hash>

The configuration parameters.

Examples

Merb::Config.use do |config|
  config[:exception_details] = false
  config[:log_stream]        = STDOUT
end

Returns

nil

:api: publicdef use

Yields:

  • (@configuration)


20
21
22
23
24
# File 'lib/mordor/config.rb', line 20

def use
  @configuration ||= {}
  yield @configuration
  nil
end