diff --git a/ChangeLog b/ChangeLog index 6e450009df..6755bf400f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Mar 31 11:52:39 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 diff --git a/lib/delegate.rb b/lib/delegate.rb index cccaea8570..6e2637393f 100644 --- a/lib/delegate.rb +++ b/lib/delegate.rb @@ -91,6 +91,12 @@ def DelegateClass(superclass) def initialize(obj) @_dc_obj = obj end + def __getobj__ + @_dc_obj + end + def __setobj__(obj) + @_dc_obj = obj + end EOS for method in methods begin @@ -108,13 +114,7 @@ def DelegateClass(superclass) raise NameError, "invalid identifier %s" % method, caller(3) end end - def __getobj__ - @_dc_obj - end - def __setobj__(obj) - @_dc_obj = obj - end - return klass; + return klass end if __FILE__ == $0