Search code examples
rubyenumerable

Why is Enumerable#each_with_object deprecated?


According to APIdock, the Ruby method Enumerable#each_with_object is deprecated.

Unless it's mistaken (saying "deprecated on the latest stable version of Rails" makes me suspicious that maybe it's Rails' monkey-patching that's deprecated), why is it deprecated?


Solution

  • Well, that seems a bit weird.

    Even Agile Rails writes somewhere:

    "The Ruby 1.9 each_with_object method was found to be so handy that the Rails crew backported it to Ruby 1.8 for you".

    This seems like an error in APIdock ? I don't see any reason why it would be.