class OrderedHash
Ruby on Rails 5.2.8.1
Since v2.2.3 Last seen in v6.1.7.10DEPRECATED: ActiveSupport::OrderedHash implements a hash that preserves insertion order.
oh = ActiveSupport::OrderedHash.new oh[:a] = 1 oh[:b] = 2 oh.keys # => [:a, :b], this order is guaranteed
Also, maps the omap feature for YAML files (See yaml.org/type/omap.html) to support ordered items when loading from yaml.
ActiveSupport::OrderedHash is namespaced to prevent conflicts with other implementations.
Inherits from
Methods (defined here)
Methods (inherited)
From Hash (40)
- # assert_valid_keys
- # compact
- # compact!
- # deep_dup
- # deep_merge
- # deep_merge!
- # deep_stringify_keys
- # deep_stringify_keys!
- # deep_symbolize_keys
- # deep_symbolize_keys!
- # deep_transform_keys
- # deep_transform_keys!
- # 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
- # transform_keys
- # transform_keys!
- # transform_values
- # transform_values!
- # with_defaults
- # with_defaults!
- # with_indifferent_access
- self. from_trusted_xml
- self. from_xml
From Object (17)
- # acts_like?
- # blank?
- # deep_dup
- # duplicable?
- # html_safe?
- # in?
- # instance_values
- # instance_variable_names
- # presence
- # presence_in
- # present?
- # to_param
- # to_query
- # try
- # try!
- # unescape
- # with_options