From fbbdeb9b577159d2481689d538d9b2437c04f220 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 31 Mar 2004 02:52:44 +0000 Subject: * lib/delegate.rb (DelegateClass): define internal methods of the result class, but not metaclass of the caller. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 11 ++++++++--- lib/delegate.rb | 8 ++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4f61bb398e..99f9ab9560 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Mar 31 11:52:26 2004 Nobuyoshi Nakada + + * lib/delegate.rb (DelegateClass): define internal methods of the + result class, but not metaclass of the caller. + Tue Mar 30 20:25:34 2004 Tanaka Akira * time.c (search_time_t): limit guess range by mktime if it is @@ -19,7 +24,7 @@ Sat Mar 27 10:40:48 2004 Tanaka Akira Thu Mar 25 23:15:24 2004 Dave Thomas - * lib/rdoc/ri/ri_options.rb (RI::Options::show_version): + * lib/rdoc/ri/ri_options.rb (RI::Options::show_version): Add --version option Thu Mar 25 04:16:18 2004 Dave Thomas @@ -35,7 +40,7 @@ Thu Mar 25 03:57:47 2004 Dave Thomas Thu Mar 25 02:00:18 2004 Dave Thomas - * lib/rdoc/generators/template/html/one_page_html.rb (Page): + * lib/rdoc/generators/template/html/one_page_html.rb (Page): Fix to work with C modules. Wed Mar 24 21:17:00 2004 Gavin Sinclair @@ -48,7 +53,7 @@ Wed Mar 24 21:17:00 2004 Gavin Sinclair * lib/uri/https.rb: Ditto. * lib/uri/ldap.rb: Ditto. * lib/uri/mailto.rb: Ditto. - (All backported from 1.9) + (All backported from 1.9) Wed Mar 24 18:48:26 2004 Nobuyoshi Nakada diff --git a/lib/delegate.rb b/lib/delegate.rb index 0069109624..3bbd148e74 100644 --- a/lib/delegate.rb +++ b/lib/delegate.rb @@ -91,6 +91,9 @@ def DelegateClass(superclass) def initialize(obj) @_dc_obj = obj end + def __getobj__ + @_dc_obj + end EOS for method in methods begin @@ -108,10 +111,7 @@ def DelegateClass(superclass) raise NameError, "invalid identifier %s" % method, caller(3) end end - def __getobj__ - @_dc_obj - end - return klass; + return klass end if __FILE__ == $0 -- cgit v1.2.3