Created
January 17, 2018 05:21
-
-
Save maxp-edcast/e4d879363da80f87b0d3346151c31c0a to your computer and use it in GitHub Desktop.
subclass through module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Subclass | |
def self.included(base) | |
base.const_set "Subclass", Class.new | |
end | |
end | |
class Foo | |
include Subclass | |
end | |
Foo::Subclass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment