module Scrivito class Deprecation class << self def warn(message, source = caller(1)) ActiveSupport::Deprecation.warn(message, source) end def warn_method(depricated_method_name, new_method_name = nil) warn(warn_method_message(depricated_method_name, new_method_name), caller(1)) end private def warn_method_message(depricated_method_name, new_method_name = nil) message = "The method #{depricated_method_name} will be removed from the Scrivito SDK. " message << "Please use #{new_method_name} instead" if new_method_name message end end end end