“...I've been working since 2008 with Ruby / Ruby on Rails, love a bit of Elixir / Phoenix and learning Rust. I also poke through other people's code and make PRs for OpenSource Ruby projects that sometimes make it. Currently working for InPay...”

Rob Lacey (contact@robl.me)
Senior Software Engineer, Brighton, UK

Hash#slice and Hash#except

Because I can never remember this…

2.1.2 :005 > {:dave => :terry, :peanuts => 1, :pickles => :eleventy_two}.slice(:dave, :peanuts)
 => {:dave=>:terry, :peanuts=>1}

And it’s nemesis

2.1.2 :006 > {:dave => :terry, :peanuts => 1, :pickles => :eleventy_two}.except(:dave, :peanuts)
 => {:pickles=>:eleventy_two}