summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-31 00:11:53 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-31 00:11:53 +0000
commit31dc2ea28fe807a9c793147ba6417cbf6f34e383 (patch)
tree8ded13ce3ba56bd9fb61feca48c4b4fb530837ea /lib
parentd3398c196ba03dfceb46d71595e9716a216f6cc1 (diff)
merges r31507 from trunk into ruby_1_9_2.
-- * lib/forwardable.rb: support 'delegate :foo => :bar' for to meet by specification of RDOC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/forwardable.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/forwardable.rb b/lib/forwardable.rb
index 06f157170d..a29dd71589 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)
}