[FIX] base_action_rule: define patched methods inside a function to fix ...

...their closure.