I
Iñaki Baz Castillo
Hi, Ruby 1.9 implements "first" method for Hash (as Hash are ordered now).
However the return value if a bit annoying for me. A real example:
irb> h =3D {"aaa"=3D>"AAA", "bbb"=3D>"BBB"}
irb> h.first
["aaa", "AAA"]
I want a method that returns the first value of a hash, rather than an arra=
y=20
containing the first hash element and value. Does such method exist?
Unfortunatelly RDoc for Hash under Ruby 1.9 seems not to exist yet:
http://ruby-doc.org/core-1.9/
Thanks.
=2D-=20
I=C3=B1aki Baz Castillo <[email protected]>
However the return value if a bit annoying for me. A real example:
irb> h =3D {"aaa"=3D>"AAA", "bbb"=3D>"BBB"}
irb> h.first
["aaa", "AAA"]
I want a method that returns the first value of a hash, rather than an arra=
y=20
containing the first hash element and value. Does such method exist?
Unfortunatelly RDoc for Hash under Ruby 1.9 seems not to exist yet:
http://ruby-doc.org/core-1.9/
Thanks.
=2D-=20
I=C3=B1aki Baz Castillo <[email protected]>