Skip to content

Instantly share code, notes, and snippets.

@maxp-edcast
Created January 17, 2018 05:21
Show Gist options
  • Save maxp-edcast/e4d879363da80f87b0d3346151c31c0a to your computer and use it in GitHub Desktop.
Save maxp-edcast/e4d879363da80f87b0d3346151c31c0a to your computer and use it in GitHub Desktop.
subclass through module
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