Class: DelegateDecorator

Inherits:
Object show all
Defined in:
lib/sugar-high/delegate.rb

Overview

Instance Method Summary collapse

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