Ruby Event Handlers: Improved Object Model

I’ve been cleaning up the implementation of Unobservable so that it better adheres to Ruby’s object model.  As a result, the following features are now available:

Singleton Events

It is possible to define singleton events on an object now.  This could be useful if you have a “one off” object and don’t feel like defining an entire class just for the one object:

Easier Event Querying

It’s much easier to figure out which Events were explicitly defined by a Class / Module, and which were inherited by other means:

Method Creation is Optional

Unobservable no longer forces you to create a Method for each Event:

Closing Remarks

Unobservable is getting closer to an official “1.0.0” release.  Some tasks that still remain:

  • Allowing developers to un-define events
  • Adding support for “Event Missing”
  • Adding basic query methods (ex:  “event_defined?” )

You can find more information about the library using the links below:

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">