Created
January 28, 2010 09:39
-
-
Save vincentp/288584 to your computer and use it in GitHub Desktop.
acts_as_something : pattern to extend class
This file contains hidden or 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 ActsAsSomething | |
| def self.included(base) | |
| base.extend ActMethods | |
| end | |
| module ActMethods | |
| def acts_as_something | |
| extend ClassMethods | |
| include InstanceMethods | |
| end | |
| end | |
| module InstanceMethods | |
| def my_instance_method | |
| end | |
| end | |
| module ClassMethods | |
| def my_class_method | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment