lib/picky/extensions/class.rb in picky-4.10.0 vs lib/picky/extensions/class.rb in picky-4.11.0
- old
+ new
@@ -1,11 +1,13 @@
# The original Class class.
#
class Class
- def instance_delegate *methods
- methods.each do |method|
- module_eval("def self.#{method}(*args, &block)\nself.instance.__send__(#{method.inspect}, *args, &block)\nend\n", "(__DELEGATION__)", 1)
+ def instance_delegate *method_names
+ method_names.each do |method_name|
+ module_eval(<<-DELEGATION, "(__DELEGATION__)", 1)
+def self.#{method_name}(*args, &block)\n self.instance.#{method_name}(*args, &block)\nend
+DELEGATION
end
end
end
\ No newline at end of file