Replies: 1 comment
-
|
Good new year to you as well! I don't think I 100% understand what you want but since you bring up You'd need something much more sophisticated like what |
Beta Was this translation helpful? Give feedback.
-
|
Good new year to you as well! I don't think I 100% understand what you want but since you bring up You'd need something much more sophisticated like what |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I found custom cops in RailsEventStore to disallow the use of instance variables and
attr_readerin event handlers. I'd like the solution to be more general. Specifically,CopBaseasserts that event handler classes are direct descendants ofInfra::EventHandler. I'd like to assert that either theClassNodeis a direct descendant ofInfra::EventHandler, or any of its ancestors isInfra::EventHandler.At first, I tried:
That didn't work because
node.parent_classisn't aClassNodebut a data structure.If this were written without Rubocop, I would have written this as
node.ancestors.include?(Infra::EventHandler).How would I translate that to Rubocop speak?
Thanks and happy new year!
Beta Was this translation helpful? Give feedback.
All reactions