module ActiveSupport::DeprecatedRangeWithFormat

def to_s(format = NOT_SET)

:nodoc:
:nodoc:
def to_s(format = NOT_SET)
  if formatter = RangeWithFormat::RANGE_FORMATS[format]
    ActiveSupport::Deprecation.warn(
      "Range#to_s(#{format.inspect}) is deprecated. Please use Range#to_fs(#{format.inspect}) instead."
    )
    formatter.call(first, last)
  elsif format == NOT_SET
    if formatter = RangeWithFormat::RANGE_FORMATS[:default]
      ActiveSupport::Deprecation.warn(
        "Using a :default format for Range#to_s is deprecated. Please use Range#to_fs instead."
      )
      formatter.call(first, last)
    else
      super()
    end
  else
    ActiveSupport::Deprecation.warn(
      "Range#to_s(#{format.inspect}) is deprecated. Please use Range#to_fs(#{format.inspect}) instead."
    )
    super()
  end
end