From: Dmitriy Makarov on
how to repeat key's?
--
Posted via http://www.ruby-forum.com/.

From: jason joo on
[Note: parts of this message were removed to make it a legal post.]

the keys for a hash are uniq.
what do u mean by 'repeat'?

2010/8/10 Dmitriy Makarov <makarovx(a)gmail.com>

> how to repeat key's?
> --
> Posted via http://www.ruby-forum.com/.
>
>

From: Dmitriy Makarov on
> what do u mean by 'repeat'?

axample in java
HashMap h=ne HashMap();
h.put("key","value_1");
h.put("key","value_2");
h.put("key","value_N");

how to made in ruby



--
Posted via http://www.ruby-forum.com/.

From: Andrei Beliankou on
On Tue, 10 Aug 2010 17:37:09 +0900
Dmitriy Makarov <makarovx(a)gmail.com> wrote:

> how to repeat key's?
do you need a multivalue hash?

{key => val1, val2, val3 ...}

From: Peter Hickman on
The Ruby hash is not a Java HashMap

x["key"] = "value_1"
x["key"] = "value_2"

puts x["key"] => "value_2"

The best you can do is:
1) Create a HashMap class for Ruby, a very simple task
2) Use lists to store the values

x["key"] = Array.new
x["key"] << "value_1"
x["key"] << "value_2"

puts x["key"] => ["value_1", "value_2"]

On 10 August 2010 10:05, Dmitriy Makarov <makarovx(a)gmail.com> wrote:
>> what do u mean by 'repeat'?
>
> axample in java
> HashMap h=ne HashMap();
> h.put("key","value_1");
> h.put("key","value_2");
> h.put("key","value_N");
>
> how to made in ruby
>
>
>
> --
> Posted via http://www.ruby-forum.com/.
>
>