lib/iron/settings/cursor.rb
# Calculates the default value for an entry, handling callable defaults.
Calculates the default value for an entry, handling callable defaults.
Calculates the default value for an entry handling callable defaults .
def item_default_value(item)
      return nil if item.group? || item.default.nil?
      if item.default.respond_to?(:call)
        val = DslProxy.exec(Cursor.new(root, @values), @context, &(item.default))
        val = Settings.parse(val, item.type)
      else
        val = item.default
      end
      Settings.restore(val, item.type)
    end
def item_default_value ( item ) return nil if item . group? || item . default . nil? if item . default . respond_to? ( :call ) val = DslProxy . exec ( Cursor . new ( root , @values ) , @context , & ( item . default ) ) val = Settings . parse ( val , item . type ) else val = item . default end Settings . restore ( val , item . type ) end
Calculates the default value for an entry, handling callable defaults.
Calculates the default value for an entry handling callable defaults .
# Callable default, call in context of a root cursor, yielding our context (generally a # model instance) to the block.
item
<not_specific>