Skip to content

Instantly share code, notes, and snippets.

@modsognir
Created October 19, 2010 23:58
Show Gist options
  • Save modsognir/635457 to your computer and use it in GitHub Desktop.
Save modsognir/635457 to your computer and use it in GitHub Desktop.
h = ActiveSupport::OrderedHash.new
h['one'] = '1'
h['two'] = '1'
h['three'] = '1'
h.find_all { true }
=> [["one", "1"], ["two", "1"], ["three", "1"]]
h.select { true }
=> {"one"=>"1", "two"=>"1", "three"=>"1"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment