Postings by Artie Ziff


Is there some reason that presents the merge method in the
example block for update method ?

<a href="" title=""></a>

thank you,

Hash["string1, string2"]

Hello Ruby Friends!

I was reviewing Ruby docs and re-learned that a Hash can be created from
what appears to be a list of strings with the requirement that there is
even number.

I try it in irb:

irb(main):004:0> Hash["stringA1", "stringA2", "stringB1", "stringB2"]
=> {"stringA1"=>"stringA2", "stringB1"=>"stringB2"}

Yet when I try to automate it with a variable I see that the argument of
list appears to be unacceptable.

In irb:

irb(main):007:0> s = ["stringA1", "stringA2", "stringB1", "stringB2"]
=> ["stringA1", "stringA2", "stringB1", "stringB2"]
irb(main):008:0> Hash[s]
(irb):8: warni