ruby-changes:11734
From: knu <ko1@a...>
Date: Sat, 9 May 2009 23:27:46 +0900 (JST)
Subject: [ruby-changes:11734] Ruby:r23380 (ruby_1_8): * lib/delegate.rb (Delegator#method_missing)
knu 2009-05-09 23:27:35 +0900 (Sat, 09 May 2009) New Revision: 23380 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23380 Log: * lib/delegate.rb (Delegator#method_missing) (DelegateClass()#method_missing): Properly pass a given block through. [ruby-dev:38390] Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/lib/delegate.rb Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 23379) +++ ruby_1_8/ChangeLog (revision 23380) @@ -1,3 +1,9 @@ +Sat May 9 23:26:04 2009 Akinori MUSHA <knu@i...> + + * lib/delegate.rb (Delegator#method_missing) + (DelegateClass()#method_missing): Properly pass a given block + through. [ruby-dev:38390] + Fri May 8 02:34:25 2009 Akinori MUSHA <knu@i...> * lib/set.rb (SortedSet#add): Do not require each newly added Index: ruby_1_8/lib/delegate.rb =================================================================== --- ruby_1_8/lib/delegate.rb (revision 23379) +++ ruby_1_8/lib/delegate.rb (revision 23380) @@ -151,12 +151,12 @@ alias initialize_methods initialize # Handles the magic of delegation through \_\_getobj\_\_. - def method_missing(m, *args) + def method_missing(m, *args, &block) target = self.__getobj__ unless target.respond_to?(m) - super(m, *args) + super(m, *args, &block) end - target.__send__(m, *args) + target.__send__(m, *args, &block) end # @@ -264,11 +264,11 @@ def initialize(obj) # :nodoc: @_dc_obj = obj end - def method_missing(m, *args) # :nodoc: + def method_missing(m, *args, &block) # :nodoc: unless @_dc_obj.respond_to?(m) - super(m, *args) + super(m, *args, &block) end - @_dc_obj.__send__(m, *args) + @_dc_obj.__send__(m, *args, &block) end def respond_to?(m, include_private = false) # :nodoc: return true if super -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/