ruby: best way to add hook(see #add_hook_for)