Class Loquacious::Undefined
In: lib/loquacious/undefined.rb
Parent: Object

Represents an undefined configuration value. An undefined value is assigned to each configuration propery by default. Any method can be invoked on an undefined value, and a warning message will be printed to the IO stream (defaulting to $stderr).

The purpose of this class is to provide the user with a helpful message that the configuration values they are trying to use have not been setup correctly.

Methods

Attributes

io  [RW] 

Public Class methods

Creates a new undefined value returned from the lookup key in some configuration object. The key is used to alert the user where the undefined value came from.

Write a warning message to the Undefined class IO stream. By default, this IO stream is set to the Ruby $stderr output.

Public Instance methods

For every method invoked on an undefined object, generate a warning message describing the undefined value and the method that was called.

Returns a new undefined object with the most recent method included in the key name.

An undefined value acts like a nil in that it has no value of its own. This method always returns true.

We can respond to any method except :call. The call method is reserved for Procs and lambdas, and it is used internally by loquacious for lazy evaluation of configuration parameters.

[Validate]