RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

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!

RubyEvents: Really simple Ruby style events/callbacks

RubyEvents is a really simple event implementation that hooks into the Object class by default; it can also be used to extend modules and classes as needed with event functionality. Now all your objects can join in the fun of firing events! RubyEvents even offers you callbacks on already defined methods, without having to do the hard work yourself, allowing callbacks on standard library methods without having to monkey patch!

Comments

Looks interesting. It’s always nice to see a different approach to a problem; a different way of thinking.

Looking at your code it looks really useful. I wonder if a more apt description of what your doing is a hook, not so much an event.

Good work though. I was needing something just like this the other day.

@mikbe It’s interesting to hear you say that, as I was wondering how best to term it (events, hooks, callbacks, etc.) Based on your suggestion, I think I may try to reword the gem description on RubyGems and GitHub to better capture this.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in