Skip to content

Instantly share code, notes, and snippets.

@hrstt
Created July 5, 2011 00:47
Show Gist options
  • Save hrstt/1064114 to your computer and use it in GitHub Desktop.
Save hrstt/1064114 to your computer and use it in GitHub Desktop.
Hash filtering
x = { "one" => "one", "two" => "two", "three" => "three"}
y = x.reject {|key,value| key == "three" }
y == { "one" => "one", "two" => "two"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment