Module: Kin::Configurable
- Defined in:
- lib/kin/configurable.rb
Overview
Provides a wrapper around Configatron, adding #configure and #config methods to extended modules.
Class Method Summary collapse
Instance Method Summary collapse
-
#config ⇒ Configatron::Store
Returns the configuration.
-
#configure {|Configatron::Store| ... } ⇒ Object
Provides a handy block notation for configuring your app/object.
Class Method Details
.extended(*args) ⇒ Object
12 13 14 15 |
# File 'lib/kin/configurable.rb', line 12 def self.extended(*args) # Load configatron on-demand. require 'configatron' end |
Instance Method Details
#config ⇒ Configatron::Store
Returns the configuration.
36 37 38 |
# File 'lib/kin/configurable.rb', line 36 def config @@_config ||= Configatron::Store.new end |
#configure {|Configatron::Store| ... } ⇒ Object
Provides a handy block notation for configuring your app/object.
27 28 29 |
# File 'lib/kin/configurable.rb', line 27 def configure yield config end |