module Substance::Objects::Defaults

Public Instance Methods

define_default(attribute, static: nil, &block) click to toggle source
# File lib/substance/objects/defaults.rb, line 24
def define_default(attribute, static: nil, &block)
  _defaults[attribute] = Value.new(static: static, &block)
end
inherited(base) click to toggle source
Calls superclass method
# File lib/substance/objects/defaults.rb, line 16
def inherited(base)
  dup = _defaults.dup
  base._defaults = dup.each { |k, v| dup[k] = v.dup }
  super
end