Created
February 11, 2014 11:21
-
-
Save mikecmpbll/8933104 to your computer and use it in GitHub Desktop.
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 Plugin1 | |
def some_method | |
puts "ha!" | |
end | |
end | |
module Plugin2 | |
def some_method_again | |
puts "hrn..." | |
end | |
end | |
module PluginContainer | |
def self.included(base) | |
base.extend(ClassMethods) | |
end | |
module ClassMethods | |
include Plugin1, Plugin2 | |
end | |
end | |
class Wooooo | |
include PluginContainer | |
end | |
Wooooo.some_method | |
=> "ha!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment