Today I Learned

Ruby's "Class < OtherClass"

Overview

You can use ruby’s “greater than” and “less than” operators for checking class inheritance.

Foo < Bar
# returns true if Foo is included in Bar's ancestors
# returns false if Foo is a Bar's descendant
# otherwise returns nil

Source: Selleo/pattern - lib/patterns/query.rb

Real life examples:

User < ActiveRecord::Base # => true
ActiveRecord::Base < User # => false
TrueClass < String # => nil