summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/delegate.rb6
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 54b5637ca..2dbc3d355 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Oct 16 20:09:55 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * lib/delegate.rb (Delegator#freeze): #freeze should freeze self
+ and the target at once. [ruby-core:26118]
+
Fri Oct 16 19:39:28 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/delegate.rb (Delegator#respond_to_missing): warn if optional
diff --git a/lib/delegate.rb b/lib/delegate.rb
index 215ebf5e4..d8a63660a 100644
--- a/lib/delegate.rb
+++ b/lib/delegate.rb
@@ -199,6 +199,12 @@ class Delegator
new
end
+ # Freeze self and target at once.
+ def freeze
+ __getobj__.freeze
+ super
+ end
+
@delegator_api = self.public_instance_methods
def self.public_api # :nodoc:
@delegator_api