Module: Alba::Deprecation

Defined in:
lib/alba/deprecation.rb,
sig/alba/deprecation.rbs

Overview

Module for printing deprecation warning

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.warn(message) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Similar to #warn but prints caller as well

Parameters:

  • message (String)

    main message to print

Returns:

  • void



11
12
13
14
# File 'lib/alba/deprecation.rb', line 11

def warn(message)
  Kernel.warn(message)
  Kernel.warn(caller_locations(2..2).first) # For performance reason we use (2..2).first
end

Instance Method Details

#warn(message) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Similar to #warn but prints caller as well

Parameters:

  • message (String)

    main message to print

Returns:

  • void



11
12
13
14
# File 'lib/alba/deprecation.rb', line 11

def warn(message)
  Kernel.warn(message)
  Kernel.warn(caller_locations(2..2).first) # For performance reason we use (2..2).first
end