Class Settings
In: lib/facets/more/settings.rb
Parent: Object

Settings holds configuration information organized by Owners. An owner is a class that represents the system to be configured. An alias for this class is Settings.

You can pass strings, constants or symbols as keys for the classes to be configured. Passing symbols you can configure classes even before they are defined.

Methods

Classes and Modules

Class Settings::Setting
Class Settings::SettingCollection

External Aliases

add_setting -> setting
settings -> all
settings -> []

Public Class methods

Manually add a Settings setting. The class key can be the actual class name constant or a symbol. If the setting is already defined it updates it.

Examples

Settings.add_setting Compiler, :verification, :value => 12, :doc => ’…’ Settings.setting :IdPart, :verify_registration_email, :value => false s = Settings.Compiler.verification.value

Load and parse an external yaml Settings file.

Parse Settings parameters in yaml format.

Return the settings for the given owner. The owner is typically the Class that represents the system to be configured. If no class is provided, it returns all the registered settings.

Inject the Settings parameters provided as a hash (dictionary, ordered) to classes to be configured.

Warning: Pass an ordered hash (dictionary)

[Validate]