diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-16 00:35:14 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-16 00:35:14 +0000 |
commit | 4156653bc05e54b2f779a7aa4ba354d957914238 (patch) | |
tree | 9c7c96afd7626cc1cc2d8f9b68908be95cb475d9 /lib | |
parent | e3ba58bb2c6918fd810ecb2839b020ae7131fa39 (diff) |
merge revision(s) 23380:
* lib/delegate.rb (Delegator#method_missing)
(DelegateClass()#method_missing): Properly pass a given block
through. [ruby-dev:38390]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@24136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/delegate.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/delegate.rb b/lib/delegate.rb index bd2b5e4813..43549946c9 100644 --- a/lib/delegate.rb +++ b/lib/delegate.rb @@ -151,12 +151,12 @@ class Delegator 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 DelegateClass(superclass) 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 |