Skip to content

Instantly share code, notes, and snippets.

@wesmaldonado
Created February 17, 2010 21:20
Show Gist options
  • Save wesmaldonado/307015 to your computer and use it in GitHub Desktop.
Save wesmaldonado/307015 to your computer and use it in GitHub Desktop.
class YohDawgDecorator
def initialize(subject)
subject.public_methods(false).each do |meth|
meth_name = "yoh_dog" + meth
(class << self; self; end).class_eval do
define_method meth_name do |*args|
subject.send meth, *args
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment