Project

General

Profile

Actions

Bug #10180

closed

#to_hash vs. #to_h

Added by herwinw (Herwin Quarantainenet) over 9 years ago. Updated over 9 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
2.1.2p95
[ruby-core:64605]

Description

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.

Actions

Also available in: Atom PDF

Like0
Like0