summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-31 02:52:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-31 02:52:44 +0000
commit993f01d8c20ab9918abd3c029d95a99f1d4b2dfc (patch)
tree6a2b0fd6bfcee7903f699a18e1d0d5c93190c455
parentb861a1196bc0a2b57e78e0a3685f35412707cb12 (diff)
downloadruby-993f01d8c20ab9918abd3c029d95a99f1d4b2dfc.tar.gz
ruby-993f01d8c20ab9918abd3c029d95a99f1d4b2dfc.tar.xz
ruby-993f01d8c20ab9918abd3c029d95a99f1d4b2dfc.zip
* lib/delegate.rb (DelegateClass): define internal methods of the
result class, but not metaclass of the caller. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/delegate.rb14
2 files changed, 12 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e450009d..6755bf400 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Mar 31 11:52:39 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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 <akr@m17n.org>
* time.c (search_time_t): limit guess range by mktime if it is
diff --git a/lib/delegate.rb b/lib/delegate.rb
index cccaea857..6e2637393 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