Class Loquacious::Configuration
In: lib/loquacious/configuration.rb
lib/loquacious/configuration/help.rb
lib/loquacious/configuration/iterator.rb
Parent: Object

Methods

[]   []=   __eigenclass_eval   __send   for   help_for   merge!   method_missing   new   obj  

Classes and Modules

Class Loquacious::Configuration::DSL
Class Loquacious::Configuration::Help
Class Loquacious::Configuration::Iterator

External Aliases

help_for -> help

Attributes

__desc  [R]  Accessor for the description hash.

Public Class methods

Returns the configuration associated with the given name. If a block is given, then it will be used to create the configuration.

The same name can be used multiple times with different configuration blocks. Each different block will be used to add to the configuration; i.e. the configurations are additive.

Returns a Help instance for the configuration associated with the given name. See the Help#initialize method for the options that can be used with this method.

Create a new configuration object and initialize it using an optional block of code.

Public Instance methods

Provides hash accessor notation for configuration values.

  config = Configuration.for('app') {
             port  1234
           }
  config[:port]  #=> 1234
  config.port    #=> 1234

Provides hash accessor notation for configuration values.

  config = Configuration.for('app')
  config[:port] = 8808
  config.port            #=> 8808

Evaluate the given code string in the context of this object‘s eigenclass (singleton class).

Only invoke public methods on the Configuration instances.

Merge the contents of the other configuration into this one. Values from the other configuratin will overwite values in this configuration.

This function is recursive. Nested configurations will be merged with their counterparts in the other configuration.

When invoked, an attribute reader and writer are defined for the method. Any arguments given are used to set the value of the attributes. If a block is given, then the attribute is a nested configuration and the block is evaluated in the context of a new configuration object.

[Validate]