If you only need the functionality of a custom rule once throughout your application, you may use a Closure instead of a rule object.