External callbacks
Add this line to your application's Gemfile:
gem 'callbacks_rb'
And then execute:
$ bundle
Or install it yourself as:
$ gem install callbacks_rb
class Foo
include CallbacksRb
callback :on_bar
def bar
fire_callback(:on_bar, 'param')
end
end
Foo.new.on_bar do |arg|
puts arg.inspect
end
Foo.bar
- Fork it ( https://github.com/abak-press/callbacks_rb/fork )
- 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 a new Pull Request