Define a function at compile-time

You can use Module.put_attribute, though I think Hooks.rule_ids needs to be a macro for that to work. The module attribute needs to be one on the module being compiled though, not on the Hooks module.