How can I create an slice for a hash in ruby looking by an array, like this:
info = { :key1 => "Lorem", :key2 => "something...", :key3 => "Ipsum" }
needed_keys = [:key1, :key3]
info = info.slice( needed_keys )
I want to receive:
{ :key1 => "Lorem", :key3 => "Ipsum" }