Read more

Slice a nested hash

Henning Koch
August 13, 2012Software engineer at makandra GmbH

The attached initializer gives your hashes a #deep_slice method that lets you recursively slice Show archive.org snapshot their contents by a given whitelist of allowed keys and sub-keys:

{ :a => { :b => 'b', :c => 'c' } }.deep_slice(:a => :c) # => { :a => { :c => 'c' } }
Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot
Posted by Henning Koch to makandra dev (2012-08-13 16:13)