class OrderedHash
Ruby on Rails 3.2.22.5
Since v2.2.3 Last seen in v6.1.7.10The 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
Methods (defined here)
- # []=
- # clear
- # delete
- # delete_if
- # each
- # each_key
- # each_pair
- # each_value
- # encode_with
- # extractable_options?
- # initialize_copy
- # inspect
- # invert
- # keys
- # merge
- # merge!
- # nested_under_indifferent_access
- # reject
- # reject!
- # replace
- # shift
- # sync_keys!
- # to_a
- # to_hash
- # to_yaml
- # to_yaml_type
- # values
- self. []
- self. new
Used by
Subclasses (1)
Methods (inherited)
From Hash (28)
- # assert_valid_keys
- # deep_dup
- # deep_merge
- # deep_merge!
- # diff
- # encode_json
- # except
- # except!
- # extract!
- # extractable_options?
- # nested_under_indifferent_access
- # reverse_merge
- # reverse_merge!
- # reverse_update
- # slice
- # slice!
- # stringify_keys
- # stringify_keys!
- # symbolize_keys
- # symbolize_keys!
- # to_options
- # to_options!
- # to_param
- # to_query
- # to_xml
- # with_indifferent_access
- self. from_trusted_xml
- self. from_xml
From Object (18)
- # acts_like?
- # blank?
- # create_fixtures
- # duplicable?
- # html_safe?
- # in?
- # instance_variable_names
- # options
- # presence
- # present?
- # test_homepage
- # to_json
- # to_param
- # to_query
- # try
- # unescape
- # with_options
- self. table_name_prefix