TinyHooks has been released
I just released a TinyHooks, a helper library to easily define hooks for your classes and modules. If you’re a gem author, please try it out or read the code (only 64 lines!) and give some feedback!
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
I just released a TinyHooks, a helper library to easily define hooks for your classes and modules. If you’re a gem author, please try it out or read the code (only 64 lines!) and give some feedback!
Comments
Is this like an alternative to ActiveSupport callbacks?
TinyHooks
is similar toActuveSupport::Callbacks
, but there are a few major differences.TinyHooks
doesn’t support halting, but will support in the future.ActiveSupport::Callbacks
has a set of methods for callbacks to work,TinyHooks
has only one method.TinyHooks
, while you need to change methods to callrun_callbacks
method within them to apply callbacks withActiveSupport::Callbacks
.Post a comment