ruby-changes:45184
From: nobu <ko1@a...>
Date: Tue, 3 Jan 2017 18:47:20 +0900 (JST)
Subject: [ruby-changes:45184] nobu:r57257 (trunk): forwardable.rb: fix branches
nobu 2017-01-03 18:47:16 +0900 (Tue, 03 Jan 2017) New Revision: 57257 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57257 Log: forwardable.rb: fix branches * lib/forwardable.rb (instance_delegate, single_delegate): fix inverted branches. Modified files: trunk/lib/forwardable.rb Index: lib/forwardable.rb =================================================================== --- lib/forwardable.rb (revision 57256) +++ lib/forwardable.rb (revision 57257) @@ -131,7 +131,7 @@ module Forwardable https://github.com/ruby/ruby/blob/trunk/lib/forwardable.rb#L131 # 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 https://github.com/ruby/ruby/blob/trunk/lib/forwardable.rb#L263 # 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)} -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/