<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>rubyco</author_name>
  <author_url>https://blog.hatena.ne.jp/rubyco/</author_url>
  <blog_title>rubyco（るびこ）の日記</blog_title>
  <blog_url>https://rubyco.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>Rubyのif文は値を持ちますから、三項演算子と等価になります。 def abs1(n) if n &gt; 0 return n else return -n end end def abs2(n) return n &gt; 0 ? n : -n end def abs3(n) x = if n &gt; 0 n else -n end return x end p abs1(-123) # =&gt; 123 p abs2(-123) # =&gt; 123 p abs3(-123) # =&gt; 123</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Frubyco.hatenadiary.org%2Fentry%2F20060128%2Fifvalue&quot; title=&quot;ifと三項演算子 - rubyco（るびこ）の日記&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>2006-01-28 00:00:03</published>
  <title>ifと三項演算子</title>
  <type>rich</type>
  <url>https://rubyco.hatenadiary.org/entry/20060128/ifvalue</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
