Today I learned
  • Github
  • Linkedin
  • Nomad Life(Travel Blog)
  • About
Sign in Subscribe

hash

A collection of 1 post
ruby

Ruby: delete multiple hash keys

Returns a hash that includes everything but the given keys. hash = { a: true, b: false, c: nil} hash.except(:c) # => { a: true, b: false} hash # => { a: true, b: false, c: nil} This is useful for limiting a set of parameters to everything but a few known toggles: @person.
24 Jul 2015
Page 1 of 1
Today I learned © 2025
Powered by Ghost