* 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:
parent
b73be705db
commit
c02e47c4e0
@ -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>
|
Fri Oct 17 00:05:53 2009 wanabe <s.wanabe@gmail.com>
|
||||||
|
|
||||||
* st.c (unpack_entries): save table->bins and never change the table
|
* st.c (unpack_entries): save table->bins and never change the table
|
||||||
|
@ -149,10 +149,12 @@ class Delegator
|
|||||||
# call through \_\_getobj\_\_.
|
# call through \_\_getobj\_\_.
|
||||||
#
|
#
|
||||||
def respond_to_missing?(m, include_private = false)
|
def respond_to_missing?(m, include_private = false)
|
||||||
if include_private
|
r = self.__getobj__.respond_to?(m, include_private)
|
||||||
warn "#{caller(3)[0]}: delegator does not forward private methods"
|
if r && include_private && !self.__getobj__.respond_to?(m, false)
|
||||||
|
warn "#{caller(3)[0]}: delegator does not forward private method \##{m}"
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
self.__getobj__.respond_to?(m)
|
r
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user