<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>pbgreen</author_name>
  <author_url>https://blog.hatena.ne.jp/pbgreen/</author_url>
  <blog_title>ゆとRubyist日記</blog_title>
  <blog_url>https://pbgreen.hatenadiary.org/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>Rubyのnilは便利ですよというお話です。 Ruby人口を増やしたいなぁということで、とても簡単な話題でいきます。(これでハードルが下がった)Ruby Advent Calendar jp: 2011 の18日目の記事です。17日目はser1zwさんです。 インスタンス変数 さて、おもむろにirbを開いて、@hogeと打ってみましょう。nilが返ってきます。 @hoge 定義されていないインスタンス変数を参照すると、nilが返ってきます。では、次のコードをご覧ください。printメソッドの中でインスタンス変数を利用する際に、nil?でnilのチェックをしてから利用しています。 class M…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpbgreen.hatenadiary.org%2Fentry%2F20111218%2F1324210195&quot; title=&quot;Rubyのnilはおともだち - ゆとRubyist日記&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>2011-12-18 21:09:55</published>
  <title>Rubyのnilはおともだち</title>
  <type>rich</type>
  <url>https://pbgreen.hatenadiary.org/entry/20111218/1324210195</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
