<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>sishow03</author_name>
  <author_url>https://blog.hatena.ne.jp/sishow03/</author_url>
  <blog_title>或るプログラマの開発日記</blog_title>
  <blog_url>https://osishow3.hateblo.jp/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>Ruby及びその他の言語に於ける真と偽の扱いのメモ。 「真」と「偽」の扱い if文やwhile文での条件判定に使う「真」と「偽」の扱いはプログラム言語により様々だったりします。例えばC言語ではint型の0が「偽」であり、それ以外が「真」です。Java言語ではプリミティブ型であるbooleanが用意されており、trueが「真」、falseが「偽」として扱われます。では、Rubyはどうなの？ということで調べて見ますと、Rubyではfalseとnilが「偽」、それ以外が「真」として扱われます。実際の挙動を見てみましょう。プログラム if nil puts &quot;nil is true&quot; else put…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fosishow3.hateblo.jp%2Fentry%2F2017%2F04%2F20%2F235500&quot; title=&quot;Rubyにおける「真」と「偽」の判定 - 或るプログラマの開発日記&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>2017-04-20 23:55:00</published>
  <title>Rubyにおける「真」と「偽」の判定</title>
  <type>rich</type>
  <url>https://osishow3.hateblo.jp/entry/2017/04/20/235500</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
