Cheers! Please, help me to solve the problem – I have a cookies, which is hash:
> cookies.keys
=> [:wishlist]
Then:
> cookies[:wishlist].keys
=> ["result_count", "results"]
results is an array of Hashie::rash
> cookies[:wishlist].results[0].keys
=> ["wrapper_type", "kind", "artist_id", ...]
cookies is hash, cookies[:wishlist] is Hashie::Rash, results is an array, which contains other Hashie::Rash’ies.
The question is how could I add new data to wishlist without deleting old data (add track to wishlist, for example)?
Assuming you have this structure:
You can simply use
Array#pushto add new items to yourresults:Output: