Module: Yt::Config
- Included in:
- Yt
- Defined in:
- lib/yt/config.rb
Overview
Note:
Config is the only module auto-loaded in the Yt module, in order to have a syntax as easy as Yt.configure
Provides methods to read and write runtime configuration information.
Configuration options are loaded from ‘~/.yt`, `.yt`, command line switches, and the `YT_OPTS` environment variable (listed in lowest to highest precedence).
Instance Method Summary collapse
-
#configuration ⇒ Object
Returns the global [Configuration](Yt/Configuration) object.
-
#configure {|Yt::Configuration| ... } ⇒ Object
Yields the global configuration to a block.
Instance Method Details
#configuration ⇒ Object
Returns the global [Configuration](Yt/Configuration) object. While you can use this method to access the configuration, the more common convention is to use [Yt.configure](Yt#configure-class_method).
47 48 49 |
# File 'lib/yt/config.rb', line 47 def configuration @configuration ||= Yt::Configuration.new end |
#configure {|Yt::Configuration| ... } ⇒ Object
Yields the global configuration to a block.
35 36 37 |
# File 'lib/yt/config.rb', line 35 def configure yield configuration if block_given? end |