Created
October 21, 2012 06:14
-
-
Save sxross/3926105 to your computer and use it in GitHub Desktop.
A Template for Building a Mixin
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 MixinTemplate | |
def self.included(base) | |
base.extend(ClassMethods) | |
base.instance_variable_set('@my_data', []) | |
end | |
module ClassMethods | |
... | |
end | |
def any_instance_method | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment