class OrderedHash

Ruby on Rails 3.2.22.5

Since v2.2.3 Last seen in v6.1.7.10

Available in: v2.2.3 v3.2.22.5 v4.0.13 v4.1.16 v4.2.9 v5.2.8.1 v6.0.6 v6.1.7.10

The order of iteration over hashes in Ruby 1.8 is undefined. For example, you do not know the order in which keys will return keys, or each yield pairs. ActiveSupport::OrderedHash implements a hash that preserves insertion order, as in Ruby 1.9:

oh = ActiveSupport::OrderedHash.new
oh[:a] = 1
oh[:b] = 2
oh.keys # => [:a, :b], this order is guaranteed

ActiveSupport::OrderedHash is namespaced to prevent conflicts with other implementations.

Inherits from

Hash

Methods (defined here)

Used by

Subclasses (1)

Methods (inherited)

From Hash (28)
From Object (18)

Type at least 2 characters to search.

↑↓ navigate · open · esc close