A datastructure to store Settings metadata.

Please note the difference between :default and :value, :default does NOT override :value.

Methods
new to_s update
Attributes
[RW] name
[RW] options
[RW] owner
[RW] type
[RW] value
Public Class methods
new(owner, name, options)
# File lib/more/facets/settings.rb, line 66
    def initialize(owner, name, options)
      if options.key? :value
        @value = options[:value]
      elsif options.key? :default
        @value = options[:default]
      else
        raise ArgumentError.new('A value is required')
      end

      @owner, @name = owner, name
      @options = options
      @type = options[:type] = options[:type] || @value.class
    end
Public Instance methods
to_s()

Text representation of this setting.

# File lib/more/facets/settings.rb, line 98
    def to_s
      @value.to_s
    end
update(hash)

Update the setting from an options hash. The update does NOT take default values into account!

# File lib/more/facets/settings.rb, line 83
    def update(hash)
      if hash.key? :value
        @value = hash[:value]
        @type = @value.class
      end

      if hash.key? :type
        @type = hash[:type]
      end

      @options.update(hash)
    end