Class: Carter::Initializer
- Inherits:
-
Object
- Object
- Carter::Initializer
- Defined in:
- lib/carter/initializer.rb
Instance Attribute Summary collapse
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Class Method Summary collapse
-
.setup(command = :process, settings = Settings.new) {|settings| ... } ⇒ Object
This is useful if you only want the load path initialized, without incurring the overhead of completely loading the entire environment.
Instance Method Summary collapse
-
#initialize(settings) ⇒ Initializer
constructor
A new instance of Initializer.
-
#process ⇒ Object
setup any defaults in here.
Constructor Details
#initialize(settings) ⇒ Initializer
Returns a new instance of Initializer.
19 20 21 |
# File 'lib/carter/initializer.rb', line 19 def initialize(settings) @settings = settings end |
Instance Attribute Details
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
17 18 19 |
# File 'lib/carter/initializer.rb', line 17 def settings @settings end |
Class Method Details
.setup(command = :process, settings = Settings.new) {|settings| ... } ⇒ Object
This is useful if you only want the load path initialized, without incurring the overhead of completely loading the entire environment.
32 33 34 35 36 37 |
# File 'lib/carter/initializer.rb', line 32 def setup(command = :process, settings = Settings.new) yield settings if block_given? initializer = new settings initializer.send(command) initializer end |