Class: DelegateDecorator
Overview
Instance Method Summary collapse
-
#initialize(subject) ⇒ DelegateDecorator
constructor
A new instance of DelegateDecorator.
Constructor Details
#initialize(subject) ⇒ DelegateDecorator
Returns a new instance of DelegateDecorator.
44 45 46 47 48 49 50 51 52 |
# File 'lib/sugar-high/delegate.rb', line 44 def initialize(subject) subject.public_methods(false).each do |meth| (class << self; self; end).class_eval do define_method meth do |*args| subject.send meth, *args end end end end |