ActionsLike0
Feature #6276
closedto_h as explicit conversion to Hash
Description
Dear Matz.
We should establish #to_h as the method for explicit conversion to Hash:
- Add Hash#to_h: returns
self
for Hash, or a Hash for subclasses of Hash - Add Struct#to_h: as requested in Feature #4862 under the wrong name
- Add OpenStruct#to_h: see Feature #1400
In addition, please consider adding NilClass#to_h.
Even though you are not completely satisfied with NilClass#to_a, I use it very often. If we ever have something equivalent to the splat operator for hashes, the same hesitations will apply to nil.to_h
, but I feel it would still bring more good than problems.
Thanks
Updated by matz (Yukihiro Matsumoto) almost 13 years ago
- Assignee changed from matz (Yukihiro Matsumoto) to marcandre (Marc-Andre Lafortune)
Updated by marcandre (Marc-Andre Lafortune) almost 13 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
Updated by naruse (Yui NARUSE) almost 13 years ago
- Status changed from Closed to Assigned
ActionsLike0