From: Hiro Asari Date: 2010-12-09T07:19:41+09:00 Subject: [ruby-core:33643] [Ruby 1.9-Bug#4136] Enumerable#reject should not inherit the receiver's instance variables Issue #4136 has been updated by Hiro Asari. In the similar vein, if you subclass Array, that class's #reject returns an object of that subclass, rather than an Array. $ irb irb(main):001:0> RUBY_DESCRIPTION => "ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]" irb(main):002:0> class A < Array; def foo; return "yo"; end; end => nil irb(main):003:0> a=A.new => [] irb(main):004:0> a.reject {}.foo => "yo" irb(main):005:0> a.collect { true }.foo NoMethodError: undefined method `foo' for []:Array from (irb):5 from :0 This is counterintuitive, at the least. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/4136 ---------------------------------------- http://redmine.ruby-lang.org