Ruby/Hash/Key value

Материал из Wiki.crossplatform.ru

(Различия между версиями)
Перейти к: навигация, поиск
м (1 версия: Импорт выборки материалов по Ruby)
 

Текущая версия на 17:57, 13 сентября 2010

objects within a hash are given a key that points to them.

dictionary = { "cat" => "feline animal", "dog" => "canine animal" }



The variable storing the hash is dictionary, and it contains two entries

dictionary = { "cat" => "feline animal", "dog" => "canine animal" }
 
puts dictionary.size