9757054e43b85442c5f99cff4ade3346fd9c458c
1 # OrderedHash is namespaced to prevent conflicts with other implementations
3 # Hash is ordered in Ruby 1.9!
4 if RUBY_VERSION >= '1.9'
7 class OrderedHash
< Array
#:nodoc:
20 pair
? pair
.last
: nil
25 pair
? array_index
= index(pair
) : nil
26 array_index
? delete_at(array_index
).last
: nil
30 collect
{ |key
, value
| key
}
34 collect
{ |key
, value
| value
}
38 returning({}) do |hash
|
39 each
{ |array
| hash
[array
[0]] = array
[1] }
47 alias_method
:key?, :has_key?
48 alias_method
:include?, :has_key?
49 alias_method
:member?, :has_key?
52 any
? { |key
, value
| value
== v
}
55 alias_method
:value?, :has_value?