Skip to content

Instantly share code, notes, and snippets.

@thomasfedb
Forked from Sutto/decoratable.rb
Created May 12, 2011 11:12
Show Gist options
  • Save thomasfedb/968333 to your computer and use it in GitHub Desktop.
Save thomasfedb/968333 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