* lib/delegate.rb (Delegator#respond_to_missing): warn only when

specified method is a private.  [ruby-dev:39498]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2009-10-17 04:22:58 +00:00
Родитель b73be705db
Коммит c02e47c4e0
2 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Sat Oct 17 08:51:44 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/delegate.rb (Delegator#respond_to_missing): warn only when
specified method is a private. [ruby-dev:39498]
Fri Oct 17 00:05:53 2009 wanabe <s.wanabe@gmail.com>
* st.c (unpack_entries): save table->bins and never change the table

Просмотреть файл

@ -149,10 +149,12 @@ class Delegator
# call through \_\_getobj\_\_.
#
def respond_to_missing?(m, include_private = false)
if include_private
warn "#{caller(3)[0]}: delegator does not forward private methods"
r = self.__getobj__.respond_to?(m, include_private)
if r && include_private && !self.__getobj__.respond_to?(m, false)
warn "#{caller(3)[0]}: delegator does not forward private method \##{m}"
return false
end
self.__getobj__.respond_to?(m)
r
end
#