Created
April 16, 2012 13:29
-
-
Save anonymous/2398827 to your computer and use it in GitHub Desktop.
decorator - keeping it simple
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
class ThingDecorator < SimpleDelegator | |
def initialize(klass) | |
@model = klass | |
super(klass) | |
end | |
def class | |
@model.class | |
end | |
# decorator methods | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment