From 210367ec889f5910e270d6ea2c7ddb8a8d939e61 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 20 Jan 1999 04:59:39 +0000 Subject: This commit was generated by cvs2svn to compensate for changes in r372, which included commits to RCS files with non-trunk default branches. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/delegate.rb | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 91 insertions(+), 9 deletions(-) (limited to 'lib/delegate.rb') diff --git a/lib/delegate.rb b/lib/delegate.rb index e5943cead8..0771f2feeb 100644 --- a/lib/delegate.rb +++ b/lib/delegate.rb @@ -1,26 +1,51 @@ # Delegation class that delegates even methods defined in super class, # which can not be covered with normal method_missing hack. # -# Delegater is the abstract delegation class. Need to redefine -# `__getobj__' method in the subclass. SimpleDelegater is the +# Delegator is the abstract delegation class. Need to redefine +# `__getobj__' method in the subclass. SimpleDelegator is the # concrete subclass for simple delegation. # # Usage: # foo = Object.new -# foo = SimpleDelegater.new(foo) -# foo.type # => Object +# foo2 = SimpleDelegator.new(foo) +# foo.hash == foo2.hash # => true +# +# Foo = DelegateClass(Array) +# +# class ExtArray true + foo2.error # raise error! end -- cgit v1.2.3