Flowdock
method

new

Importance_1
Ruby on Rails latest stable (v6.1.7.7) - 0 notes - Class: ActiveSupport::OrderedHash

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v3.2.13) is shown here.

These similar methods exist in v6.1.7.7:

new(*args, &block) public

In MRI the Hash class is core and written in C. In particular, methods are programmed with explicit C function calls and polymorphism is not honored.

For example, []= is crucial in this implementation to maintain the @keys array but hash.c invokes rb_hash_aset() originally. This prevents method reuse through inheritance and forces us to reimplement stuff.

For instance, we cannot use the inherited #merge! because albeit the algorithm itself would work, our []= is not being called at all by the C code.

Show source
Register or log in to add new notes.