I have array that element is hash
a = [{:history_date=>"15/07/10"}, {:open_price=>"7.90"}]
I want to convert to this
h = {:history_date=>"15/07/10", :open_price=>"7.90"}
someone please help me.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
How about:
Each hash in the array is merged into the previous hash until we get down to one element.
&:mergeis shorthand for the following, which may be easier to understand, but is slightly longer: