site5/rainman — Issue #2: Allow handler hooks
Author: tfwright
Created: 2012-02-24 15:58:32+00:00
State: open

Refactor to allow for method hooks on delegation of actions to handlers. Current use case is the need to add logging to a handler that makes a lot of API calls, and we don't want to have to add a logger call to ever action def. Two possible ways to do this:

1. option passed in to `define_action` that takes a proc to be called before that method is executed.
2. A Rails-style `before` class method on handlers.

Question: Is this necessary? The thought occurs to me that, for logging anyway, that logging could/should be implemented at the level of the API wrapper, which the handler would be calling.