Module: Configliere::ConfigBlock
- Defined in:
- lib/configliere/config_block.rb
Overview
ConfigBlock lets you use pure ruby to change and define settings. Call #finally
with a block of code to be run after all other settings are in place.
Settings.finally{|c| c.your_mom[:college] = 'went' unless (! c.mom_jokes_allowed) }
Instance Method Summary collapse
-
#finally(&block) ⇒ Object
Define a block of code to run after all other settings are in place.
-
#resolve! ⇒ Object
Processing to reconcile all options.
Instance Method Details
#finally(&block) ⇒ Object
Define a block of code to run after all other settings are in place.
27 28 29 |
# File 'lib/configliere/config_block.rb', line 27 def finally &block self.final_blocks << block if block end |
#resolve! ⇒ Object
Processing to reconcile all options
The resolve! for config_block is made to run last of all in the resolve!
chain, and runs each finally
block in the order it was defined.
35 36 37 38 39 |
# File 'lib/configliere/config_block.rb', line 35 def resolve! super resolve_finally_blocks! self end |