Hi!
I've just faced an offence with code: !(klass < BaseClass) which checks that class from variable is not a subclass of BaseClass. Here is the message:
RuboCop: Style/InverseMethods: Use `>` instead of inverting `<=`
I've checked issues but have not found related. I think there is no way to make this cop handle correctly Number#< and Module#<. WDYT?
PS. in this particular case it was ok for me to switch to <=>, because it's guaranteed that klass can not be superclass of BaseClass.
Style/InverseMethods could be changed to suppress offenses when one of the operands looks like a class or module (capital first letter, but not all-caps).
I keep learning new things about Ruby after all those years - I was always using the ancestors method. 馃槃
Matz:
You shouldn't really be doing type checks in Ruby.
Also Matz:
Let's add some zany facilities for advanced type checking.
馃槄
Most helpful comment
I keep learning new things about Ruby after all those years - I was always using the
ancestorsmethod. 馃槃