<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>osyo-manga</author_name>
  <author_url>https://blog.hatena.ne.jp/osyo-manga/</author_url>
  <blog_title>Secret Garden(Instrumental)</blog_title>
  <blog_url>https://secret-garden.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>一人 Ruby Advent Calendar 2017 3日目の記事になります。 さて、今回は case 式の when 節と #=== 演算子について簡単に解説してみたいと思います。 case 式 さてさて、Ruby の case 式は以下のようにして when 節と組み合わせて使います。 def func n case n # n の値が when に渡した値であればその式を評価して返す when 1 &quot;one&quot; when 2 &quot;two&quot; when 3 &quot;three&quot; else &quot;other&quot; end end p (1..5).map &amp;method(:func) # =&gt; [&quot;one&quot;…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsecret-garden.hatenablog.com%2Fentry%2F2017%2F12%2F03%2F214333&quot; title=&quot;【一人 Ruby Advent Calendar 2017】case-when と === 演算子について【3日目】 - Secret Garden(Instrumental)&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-12-03 21:43:33</published>
  <title>【一人 Ruby Advent Calendar 2017】case-when と === 演算子について【3日目】</title>
  <type>rich</type>
  <url>https://secret-garden.hatenablog.com/entry/2017/12/03/214333</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
