Project

General

Profile

Actions

Feature #6442

closed

CRUDify Hash class

Feature #6442: CRUDify Hash class

Added by trans (Thomas Sawyer) over 13 years ago. Updated almost 8 years ago.

Status:
Feedback
Target version:
-
[ruby-core:45095]

Description

Ruby's Hash class is not very internally "connascent" --many different methods access the underlying data. There is no core set of specific methods that can be overridden to handle all cases. This leads to a very unDRY and bloated class when subclassing or delegating. If Ruby's Hash could be modified to follow essentially a CRUD model, with single points-of-entry for the creation, reading, updating and deletion of entries, and all other methods route through these core methods for access to the underlying data, then it would be much easier to subclass and delegate, and make the Hash class much more solid in design.

I believe the core methods needed are: read(key), store(key,value), delete(key) as well as key?(key) and keys.


Related issues 1 (0 open1 closed)

Related to Ruby - Feature #6737: Add Hash#read and alias as #[].FeedbackActions

Updated by nobu (Nobuyoshi Nakada) over 13 years ago Actions #1

  • Status changed from Open to Feedback
  • Assignee set to trans (Thomas Sawyer)

Patches welcome.

Updated by yhara (Yutaka HARA) almost 13 years ago Actions #2 [ruby-core:48250]

  • Target version changed from 2.0.0 to 2.6

Updated by naruse (Yui NARUSE) almost 8 years ago Actions #3

  • Target version deleted (2.6)
Actions

Also available in: PDF Atom