Skip to content

Instantly share code, notes, and snippets.

@Sutto
Forked from thomasfedb/decoratable.rb
Created May 12, 2011 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Sutto/968195 to your computer and use it in GitHub Desktop.
Save Sutto/968195 to your computer and use it in GitHub Desktop.
class Decorator
def initialize(decorated)
@decorated = decorated
end
def method_missing(method, *args, &blk)
@decorated.send(method, *args, &blk)
end
end
module Decoratable
def with(decorator)
decorator.new(self)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment