Ruby 2.5 by example: Hash.slice
BigBinary shouted it out loud.
pizza = { id: 1, name: 'Big Cheezy', description: 'Big Chezzy Pizza, pure happiness!' }
pizza.slice(:name, :description)
# => {:name => 'Big Cheezy', :description => 'Big Chezzy Pizza, pure happiness!'}
BigBinary have a neat collection of articles about Ruby 2.5
http://blog.bigbinary.com/categories/Ruby-2-5
⬅️ Read previous Read next ➡️