Sha256: 9ec65346264189f5dd370e415271854f16a5ea2e01b5211e6cb3c41792cf5cae
Contents?: true
Size: 909 Bytes
Versions: 16
Compression:
Stored size: 909 Bytes
Contents
# frozen_string_literal: true # -*- ruby encoding: utf-8 -*- require 'mime/types/logger' # The namespace for MIME applications, tools, and libraries. module MIME ## class Types # Used to mark a method as deprecated in the mime-types interface. def self.deprecated(klass, sym, message = nil, &block) # :nodoc: level = case klass when Class, Module '.' else klass = klass.class '#' end message = case message when :private, :protected "and will be #{message}" when nil 'and will be removed' else message end MIME::Types.logger.warn <<-WARNING.chomp #{caller[1]}: #{klass}#{level}#{sym} is deprecated #{message}. WARNING block.call if block end end end
Version data entries
16 entries across 14 versions & 3 rubygems