Class: Lotus::Config::FrameworkConfiguration Private
- Inherits:
- BasicObject
- Defined in:
- lib/lotus/config/framework_configuration.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Collects all the settings for a given framework configuration and then forwards them when the application is loaded.
Instance Method Summary collapse
- #__add(&blk) ⇒ Object private
- #__apply(configuration) ⇒ Object private
-
#initialize(&blk) ⇒ FrameworkConfiguration
constructor
private
A new instance of FrameworkConfiguration.
- #method_missing(m, *args, &blk) ⇒ Object private
Constructor Details
#initialize(&blk) ⇒ FrameworkConfiguration
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.
Returns a new instance of FrameworkConfiguration.
11 12 13 14 |
# File 'lib/lotus/config/framework_configuration.rb', line 11 def initialize(&blk) @blocks = [blk || ::Proc.new { }] @settings = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &blk) ⇒ 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.
37 38 39 |
# File 'lib/lotus/config/framework_configuration.rb', line 37 def method_missing(m, *args, &blk) @settings.push([m, args, blk]) end |
Instance Method Details
#__add(&blk) ⇒ 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.
30 31 32 33 |
# File 'lib/lotus/config/framework_configuration.rb', line 30 def __add(&blk) @blocks << blk self end |
#__apply(configuration) ⇒ 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.
18 19 20 21 22 23 24 25 26 |
# File 'lib/lotus/config/framework_configuration.rb', line 18 def __apply(configuration) @blocks.compact.each do |blk| configuration.instance_eval(&blk) end @settings.each do |(m, args, blk)| configuration.public_send(m, *args, &blk) end end |