How can I append a value in a Hash object using a key that already has a value. So for example if I have >> my_hash = Hash.new >> my_hash[:my_key] = "Value1" # then append a value, lets say "Value2" to my hash, using that same key "my_key" # so that it can be >> my_hash[:my_key] => ["Value1", "Value2"] I know its easy to write my own method, but I just wanted to know if there is a built in method.
keys -> [object][permalink][rdoc][edit] 全キーの配列を返します。 例 h1 = { "a" => 100, 2 => ["some"], :c => "c" } p h1.keys #=> ["a", 2, :c] [SEE_ALSO] Hash#values,Hash#to_a
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く