Home
Ruby
ActiveRecord
Array
CGI
Class
Collections
Database
Date
Design Patterns
Development
File Directory
GUI
Hash
Language Basics
Method
Network
Number
Rails
Range
Reflection
Statement
String
Threads
Time
Tk
Unit Test
Windows Platform
XML
swap keys and values : invert « Hash « Ruby
Ruby
Hash
invert
swap keys and values
h = {:a=>1, :b=>2} h.invert # => {1=>:a, 2=>:b}: swap keys and values
Related examples in the same category