# File lib/sugar-high/delegate.rb, line 44 def initialize(subject, options = {}) options[:only] ||= [] options[:except] ||= [] options[:only].map!(&:to_s) options[:except].map!(&:to_s) meths = subject.public_methods(false) meths = meths & options[:only] unless options[:only].empty? meths.each do |meth| (class << self; self; end).class_eval do unless options[:except].include? meth.to_s define_method meth do |*args| subject.send meth, *args end end end end end
Generated with the Darkfish Rdoc Generator 2.