jeudi 9 février 2017

Convert into array Ruby

timing[:start_at] = {"0"=>"Thu Feb 09 2017 21:02:00 GMT+0500 (PKT)", "1"=>"Thu Feb 09 2017 22:02:00 GMT+0500 (PKT)"}

i have a hash of date_time and i want it to be like array under hash so i can access it like

timing[:start_at][0]

i can access it like

timing[:start_at]["0"] 

but i cant access it like

timing[:start_at][0]

how can i modify it to be a array under hash.

Aucun commentaire:

Enregistrer un commentaire