From: matz@... Date: 2014-08-28T11:12:13+00:00 Subject: [ruby-core:64606] [ruby-trunk - Bug #10180] [Rejected] #to_hash vs. #to_h Issue #10180 has been updated by Yukihiro Matsumoto. Status changed from Open to Rejected Ruby often has two conversion methods for an object, e.g. #to_s and #to_str, #to_i and #to_int, #to_h and #to_hash. The former is used for explicit conversion, the latter is used for implicit conversion (from an object with identical method signature e.g. proxy). Matz. ---------------------------------------- Bug #10180: #to_hash vs. #to_h https://bugs.ruby-lang.org/issues/10180#change-48525 * Author: Herwin . * Status: Rejected * Priority: Normal * Assignee: * Category: * Target version: * ruby -v: 2.1.2p95 * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- The class Hash has a method try_convert, that is documented as "Try to convert obj into a hash, using #to_hash method." Surpisingly, the Array class doesn't have a method to_hash, but it does have a method to_h which converts it into a Hash. This looks like there are two possible methods with different names, but with the same expected behaviour, which breaks some usage of Hash#try_convert. -- https://bugs.ruby-lang.org/