<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>lamanotrama</author_name>
  <author_url>https://blog.hatena.ne.jp/lamanotrama/</author_url>
  <blog_title>lamanotrama's diary</blog_title>
  <blog_url>https://lamanotrama.hateblo.jp/</blog_url>
  <categories>
    <anon>ruby</anon>
  </categories>
  <description>ruby本（ピッケル本）を読み進めてたら、こんな感じのコードがありました。 hash = {} hash['hoge'] = [] if hash['hoge'].nil? hash['hoge'].push('a') これを見て、2行目冗長じゃね？とruby歴4日のベテランであるところの僕は思いました。 初期値決めときゃええやん。 irb(main):001:0&gt; hash = Hash.new([]) =&gt; {} irb(main):002:0&gt; hash['hoge'].push('a') =&gt; [&quot;a&quot;] が！ irb(main):003:0&gt; hash =&gt; {} 空やんけ！さらに …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Flamanotrama.hateblo.jp%2Fentry%2F20080317%2F1205728901&quot; title=&quot;rubyのHashの挙動が謎な件 - lamanotrama&amp;#39;s diary&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-03-17 13:41:41</published>
  <title>rubyのHashの挙動が謎な件</title>
  <type>rich</type>
  <url>https://lamanotrama.hateblo.jp/entry/20080317/1205728901</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
