| Class | Merb::Config |
| In: |
lib/merb-core/config.rb
lib/merb-core/dispatch/session.rb |
| Parent: | Object |
| configuration | [RW] | :api: private |
Set configuration parameters from a code block, where each method evaluates to a config parameter.
| &block: | Configuration parameter block. |
# Set environment and log level.
Merb::Config.configure do
environment "development"
log_level "debug"
log_file Merb.root / "log" / "special.log"
end
nil
:api: public
Retrieve the value of a config entry, returning the provided default if the key is not present
| key<Object>: | The key to retrieve the parameter for. |
| default<Object>: | The default value to return if the parameter is not set. |
| Object: | The value of the configuration parameter or the default. |
:api: public
Detects whether the provided key is in the config.
| key<Object>: | The key to check. |
| Boolean: | True if the key exists in the config. |
:api: public
Allows retrieval of single key config values via Merb.config.<key> Allows single key assignment via Merb.config.<key> = …
| method<~to_s>: | Method name as hash key value. |
| *args: | Value to set the configuration parameter to. |
The value of the entry fetched or assigned to.
:api: public
Parses the command line arguments and stores them in the config.
| argv<String>: | The command line arguments. Defaults to ARGV. |
The configuration as a hash.
:api: private
Returns stores list constructed from configured session stores (:session_stores config option) or default one (:session_store config option).
:api: private
Yields the configuration.
| c<Hash>: | The configuration parameters. |
Merb::Config.use do |config|
config[:exception_details] = false
config[:log_stream] = STDOUT
end
nil
:api: public