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.

Since:

  • 0.2.0

Instance Method Summary collapse

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.

Since:

  • 0.2.0



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.

Since:

  • 0.2.0



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.

Since:

  • 0.6.0



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.

Since:

  • 0.2.0



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