<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>shinkufencer</author_name>
  <author_url>https://blog.hatena.ne.jp/shinkufencer/</author_url>
  <blog_title>コード日進月歩</blog_title>
  <blog_url>https://shinkufencer.hateblo.jp/</blog_url>
  <categories>
    <anon>Ruby</anon>
    <anon>Tips</anon>
  </categories>
  <description>表題の通りシリーズ、直感的にそうなるんじゃね？と思っていても試したことなかったのでメモ 環境 $ ruby -v ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin18] 例 test.rb として以下のファイルを用意する def one_of_true(target) true if target == 1 end pp one_of_true(1) pp one_of_true(0) 下記のような結果になる $ ruby test.rb true nil 原理 右辺の条件が成立する時に、左辺の式を評価してその結果を返します。 条件…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fshinkufencer.hateblo.jp%2Fentry%2F2019%2F02%2F02%2F233000&quot; title=&quot;Rubyでメソッドの最終行にif修飾子(後置if)を使って条件に当てはまらない場合はnil - コード日進月歩&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>2019-02-02 23:30:00</published>
  <title>Rubyでメソッドの最終行にif修飾子(後置if)を使って条件に当てはまらない場合はnil</title>
  <type>rich</type>
  <url>https://shinkufencer.hateblo.jp/entry/2019/02/02/233000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
