Why is Enumerable#each_with_object deprecated?

后端 未结 3 498
甜味超标
甜味超标 2020-12-09 04:59

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

Unless it\'s mistaken (saying \"deprecated on the latest stable versio

3条回答
  •  [愿得一人]
    2020-12-09 05:32

    There's no note in the Ruby trunk source code, the method is still there (contrary to that page's claims), and there's been no talk of it on the mailing list that I can find.

    APIdock is simply confused. The point where APIdock says it was deprecated is actually the earliest version with the method in the standard library (rather than just being an ActiveSupport backport extension), and Rails disables its version if you're using a Ruby that has the method, so APIdock appears to be confused by the method migrating between projects.

提交回复
热议问题