Class: Liquid::Deprecations

Inherits:
Object
  • Object
show all
Defined in:
lib/liquid/deprecations.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.warnedObject

Returns the value of attribute warned.



8
9
10
# File 'lib/liquid/deprecations.rb', line 8

def warned
  @warned
end

Class Method Details

.warn(name, alternative) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/liquid/deprecations.rb', line 12

def warn(name, alternative)
  return if warned.include?(name)

  warned << name

  caller_location = caller_locations(2, 1).first
  Warning.warn("[DEPRECATION] #{name} is deprecated. Use #{alternative} instead. Called from #{caller_location}\n")
end