Skip to content

Instantly share code, notes, and snippets.

@benhoskings
Created March 29, 2010 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save benhoskings/347921 to your computer and use it in GitHub Desktop.
Save benhoskings/347921 to your computer and use it in GitHub Desktop.
class Hash
def selekt &block
inject({}) {|hsh,(k,v)|
hsh[k] = v if yield(k,v)
hsh
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment