Last Updated: February 25, 2016
·
249
· jwaldrip

Ever wonder if a module is included?

Have you ever wondered if a certain module is included in your class, or if you are inheriting from something far up the chain. Well thats easy you can use the <, <=, >, >= operators.

Array < Enumerable
=> true

String < Integer
=> false

# okay now inheritance
User < ActiveRecord::Base
=> true

Class < Module
=> true