зеркало из https://github.com/github/ruby.git
forwardable.rb: fix branches
* lib/forwardable.rb (instance_delegate, single_delegate): fix inverted branches. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
a50cc9ce08
Коммит
0886a02707
|
@ -131,7 +131,7 @@ module Forwardable
|
|||
#
|
||||
def instance_delegate(hash)
|
||||
hash.each do |methods, accessor|
|
||||
if defined?(methods.each)
|
||||
unless defined?(methods.each)
|
||||
def_instance_delegator(accessor, methods)
|
||||
else
|
||||
methods.each {|method| def_instance_delegator(accessor, method)}
|
||||
|
@ -263,7 +263,7 @@ module SingleForwardable
|
|||
#
|
||||
def single_delegate(hash)
|
||||
hash.each do |methods, accessor|
|
||||
if defined?(methods.each)
|
||||
unless defined?(methods.each)
|
||||
def_single_delegator(accessor, methods)
|
||||
else
|
||||
methods.each {|method| def_single_delegator(accessor, method)}
|
||||
|
|
Загрузка…
Ссылка в новой задаче