lib/nrser/props/prop.rb
# Get the default value for the property given the instance and values.
# 
# @todo
#   This is a shitty hack stop-gap until I really figure our how this should
#   work.
# 
# @param [Hash<Symbol, Object>] values
#   Other prop values known at this point, keyed by name.
# 
# @return [Object]
#   Default value.
# 
# @raise [NameError]
#   If the prop doesn't have a default.
# 
Get the default value for the property given the instance and values.
Get the default value for the property given the instance and values .
def default **values
    if has_default?
      if Proc === @default
        case @default.arity
        when 0
          @default.call
        else
          kwds = values.slice *deps
          @default.call **kwds
        end
      else
        @default
      end
    else
      raise NameError.new,
        "Prop <%= full_name %> has no default value (and none provided)."
    end
  end
def default ** values if has_default? if Proc === @default case @default . arity when 0 @default . call else kwds = values . slice * deps @default . call ** kwds end else @default end else raise NameError . new , "Prop <%= full_name %> has no default value (and none provided)." end end
Get the default value for the property given the instance and values.
Get the default value for the property given the instance and values .
None
Object
[NameError] If the prop doesn't have a default.
[ NameError ] If the prop doesn ' t have a default .
values
<not_specific>
<not_specific>
values Other prop values known at this point, keyed by name.
values Other prop values known at this point keyed by name .
todo
This is a shitty hack stop-gap until I really figure our how this should work.
This is a shitty hack stop - gap until I really figure our how this should work .