How to get first 10 items from hash in ruby?

How about hashTable.sort.keys[0,10].each { |key| puts "#{key} #{hashTable[key]} }

Christian