From: Alexey Muranov Date: 2012-10-28T17:16:33+09:00 Subject: When to use Ruby DelegateClass instead of SimpleDelegator? I am mostly re-posting my question from SO, because i think it can get lost there, and i hope that on this specialized forum i would get some explanation. http://stackoverflow.com/questions/13104942 So, i do not understand how and when to use Ruby's `DelegateClass` method instead of `SimpleDelegator` class. All of the following seem to work mostly identically: a = SimpleDelegator.new([0]) b = DelegateClass(Array).new([0]) c = DelegateClass(String).new([0]) a << 1 b << 2 c << 3 p a # => [0, 1] p b # => [0, 2] p c # => [0, 3] It does not seem to matter which class is passed to DelegateClass. Alexey. -- Posted via http://www.ruby-forum.com/.