class ActiveSupport::OrderedHash
with other implementations.ActiveSupport::OrderedHash
is namespaced to prevent conflicts
when loading from yaml.
(See yaml.org/type/omap.html) to support ordered items
Also, maps the omap
feature for YAML files
oh.keys # => [:a, :b], this order is guaranteed<br>oh = 2<br>oh = 1
oh = ActiveSupport::OrderedHash.new
insertion order.ActiveSupport::OrderedHash
implements a hash that preserves
def encode_with(coder)
def encode_with(coder) coder.represent_seq '!omap', map { |k,v| { k => v } } end
def extractable_options?
def extractable_options? true end
def nested_under_indifferent_access
def nested_under_indifferent_access self end
def reject(*args, &block)
def reject(*args, &block) dup.tap { |hash| hash.reject!(*args, &block) } end
def select(*args, &block)
def select(*args, &block) dup.tap { |hash| hash.select!(*args, &block) } end
def to_yaml_type
def to_yaml_type "!tag:yaml.org,2002:omap" end