def new_value(*args, &block)
      value = value_from_args(args, &block)

      value = if incremental
                incremental_value(value)
              else
                filter_value(transformed_value(value))
              end

      if value_valid?(value)
        self.custom_value = value
      elsif invalid.to_s == 'default' && !incremental
        default_value
      else
        fail ArgumentError, "The value #{value.inspect} is not valid."
      end
    end
def new_value(*args, &block)
      value = value_from_args(args, &block)

      value = if incremental
                incremental_value(value)
              else
                filter_value(transformed_value(value))
              end

      if value_valid?(value)
        self.custom_value = value
      elsif invalid.to_s == 'default' && !incremental
        default_value
      else
        fail ArgumentError, "The value #{value.inspect} is not valid."
      end
    end
Extracts options and sets all the parameters.


 Builds a new value for the option.
 It automatically applies transformations and filters and validates the
 resulting value, raising an exception if the value is not valid.