123456789_123456789_123456789_123456789_123456789_

Module: Concurrent::Concern::Deprecation

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Extended In:
Included In:
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
self, Logging
Defined in: lib/concurrent-ruby/concurrent/concern/deprecation.rb

Overview

Note:

**Private Implementation:** This abstraction is a private, internal implementation detail. It should never be used directly.

Constant Summary

Logging - Included

SEV_LABEL

Instance Method Summary

Instance Method Details

#deprecated(message, strip = 2)

[ GitHub ]

  
# File 'lib/concurrent-ruby/concurrent/concern/deprecation.rb', line 12

def deprecated(message, strip = 2)
  caller_line = caller(strip).first if strip > 0
  klass       = if Module === self
                  self
                else
                  self.class
                end
  message     = if strip > 0
                  format("[DEPRECATED] %s\ncalled on: %s", message, caller_line)
                else
                  format('[DEPRECATED] %s', message)
                end
  log WARN, klass.to_s, message
end

#deprecated_method(old_name, new_name)

[ GitHub ]

  
# File 'lib/concurrent-ruby/concurrent/concern/deprecation.rb', line 27

def deprecated_method(old_name, new_name)
  deprecated "`#{old_name}` is deprecated and it'll removed in next release, use `#{new_name}` instead", 3
end