Module: Fauna::Deprecate
- Included in:
- Query
- Defined in:
- lib/fauna/deprecate.rb
Instance Method Summary collapse
-
#deprecate(name, replacement) ⇒ Object
Deprecates a method.
Instance Method Details
#deprecate(name, replacement) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/fauna/deprecate.rb', line 20 def deprecate(name, replacement) old_name = "deprecated_#{name}" alias_method old_name, name define_method name do |*args, &block| warn "Method #{name} called from #{Gem.location_of_caller.join(':')} is deprecated. Use #{replacement} instead" self.__send__ old_name, *args, &block end end |