def default(context = nil)
      raise NoDefaultError, name unless default?

      value = raw_default(context)
      raise InvalidValueError if value.is_a?(GroupedInput)

      cast(value, context)
    rescue InvalidNestedValueError => error
      raise InvalidDefaultError, "#{name}: #{value.inspect} (#{error})"
    rescue InvalidValueError, MissingValueError
      raise InvalidDefaultError, "#{name}: #{value.inspect}"
    end
def default(context = nil)
      raise NoDefaultError, name unless default?

      value = raw_default(context)
      raise InvalidValueError if value.is_a?(GroupedInput)

      cast(value, context)
    rescue InvalidNestedValueError => error
      raise InvalidDefaultError, "#{name}: #{value.inspect} (#{error})"
    rescue InvalidValueError, MissingValueError
      raise InvalidDefaultError, "#{name}: #{value.inspect}"
    end
Get the default value.

 @example
   ActiveInteraction::Filter.new(:example).default
   # => ActiveInteraction::NoDefaultError: example
 @example
   ActiveInteraction::Filter.new(:example, default: nil).default
   # => nil
 @example
   ActiveInteraction::Filter.new(:example, default: 0).default
   # => ActiveInteraction::InvalidDefaultError: example: 0

 @param context [Base, nil]

 @return (see #raw_default)

 @raise [NoDefaultError] If the default is missing.
 @raise [InvalidDefaultError] If the default is invalid.