Class: Merb::Config::ConfigBlock
Overview
class << self
Instance Method Summary collapse
-
#initialize(klass, &block) ⇒ ConfigBlock
constructor
private
Evaluates the provided block, where any call to a method causes #[]= to be called on klass with the method name as the key and the arguments as the value.
-
#method_missing(method, *args) ⇒ Object
private
Assign args as the value of the entry keyed by method.
Constructor Details
#initialize(klass, &block) ⇒ ConfigBlock
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Evaluates the provided block, where any call to a method causes #[]= to be called on klass with the method name as the key and the arguments as the value.
Parameters
- klass<Object~[]=>
-
The object on which to assign values.
- &block
-
The block which specifies the config values to set.
Returns
nil
447 448 449 450 |
# File 'lib/merb-core/config.rb', line 447 def initialize(klass, &block) @klass = klass instance_eval(&block) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Assign args as the value of the entry keyed by method.
455 456 457 |
# File 'lib/merb-core/config.rb', line 455 def method_missing(method, *args) @klass[method] = *args end |