class Middleman::Configuration::ConfigSetting
An individual configuration setting, with an optional default and description. Also models whether or not a value has been set.
Attributes
The default value for this setting
A human-friendly description of the setting
The name of this setting
Additional config.
Public Class Methods
Source
# File lib/middleman-core/configuration.rb, line 130 def initialize(key, default, description, options={}) @value_set = false self.key = key self.default = default self.description = description self.options = options end
Public Instance Methods
Source
# File lib/middleman-core/configuration.rb, line 147 def value value_set? ? @value : default end
The effective value of the setting, which may be the default if the user has not set a value themselves. Note that even if the user sets the value to nil it will override the default.
Source
# File lib/middleman-core/configuration.rb, line 139 def value=(value) @value = value @value_set = true end
The user-supplied value for this setting, overriding the default
Source
# File lib/middleman-core/configuration.rb, line 152 def value_set? @value_set == true end
Whether or not there has been a value set beyond the default