MethodWatcher
Provide method_overriding callback.
Installation
Add this line to your application's Gemfile:
gem 'method_watcher'
And then execute:
$ bundle
Or install it yourself as:
$ gem install method_watcher
Usage
require 'method_watcher'
class A
include MethodWatcher
def foo
end
def
end
watch_methods :foo, :bar
end
class B < A
def foo
end
end
#you will get a warning:
#method A#foo is overridden
#you can define you own behavior when method overriding.
#in class A:
def self.method_overriding method
puts "OMG, method #{method} is overridden!!"
end
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request