module Sparsify::Deprecations

Public Class Methods

deprecate(message, target) click to toggle source
# File lib/sparsify/deprecations.rb, line 8
def deprecate(message, target)
  @deprecations ||= Set.new
  msg = "Sparsify: #{message} is deprecated " +
        "and will be removed in #{target} (at #{external_callpoint})"
  warn(msg) if @deprecations.add?(msg)
end

Private Class Methods

external_callpoint() click to toggle source
# File lib/sparsify/deprecations.rb, line 17
def external_callpoint
  caller.drop_while { |loc| loc['lib/sparsify/'] }.first
end

Private Instance Methods

deprecate(message, target) click to toggle source
# File lib/sparsify/deprecations.rb, line 24
def deprecate(message, target)
  Deprecations.deprecate(message, target)
end