diff --git a/ChangeLog b/ChangeLog index 6a13040734..e029fdaaf9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed May 11 19:45:27 2011 Keiju Ishitsuka + + * lib/forwardable.rb: support 'delegate :foo => :bar' for to meet + by specification of RDOC. + Wed May 11 08:36:38 2011 Eric Hodel * lib/webrick: Add documentation for WEBrick::HTTPAuth diff --git a/lib/forwardable.rb b/lib/forwardable.rb index 636d2d0d0a..11d8691c8b 100644 --- a/lib/forwardable.rb +++ b/lib/forwardable.rb @@ -149,7 +149,7 @@ module Forwardable # def instance_delegate(hash) hash.each{ |methods, accessor| - methods = methods.to_s unless methods.respond_to?(:each) + methods = [methods] unless methods.respond_to?(:each) methods.each{ |method| def_instance_delegator(accessor, method) } @@ -214,7 +214,7 @@ module SingleForwardable # def single_delegate(hash) hash.each{ |methods, accessor| - methods = methods.to_s unless methods.respond_to?(:each) + methods = [methods] unless methods.respond_to?(:each) methods.each{ |method| def_single_delegator(accessor, method) }