class EcoRake module Sample module Concern module Base class << self def included(base) super(base) base.extend ClassMethods end end module ClassMethods def included(base) super(base) base.extend self::ClassMethods if defined?(self::ClassMethods) end end end end end end