<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ya1ta1</author_name>
  <author_url>https://blog.hatena.ne.jp/ya1ta1/</author_url>
  <blog_title>ya1:tech</blog_title>
  <blog_url>https://ya1teck.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>case を使うと、プログラムの処理を条件分岐させることができます。 「比較対象となる値が○○に当てはまったら、△△の処理を行う」といった制御ができます。 case 比較対象となる値 when 値1 # オブジェクトが値1と一致したときに実行する処理 when 値2 # オブジェクトが値2と一致したときに実行する処理 else # どの when節の値とも一致しないときに実行する処理 end 数値 num = 1 case num when 1 p &quot;num は 1 である&quot; when 2 p &quot;num は 2 である&quot; else p &quot;条件に一致しない&quot; end #実行結果 &quot;num は 1…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fya1teck.hatenablog.com%2Fentry%2F2020%2F10%2F15%2F224035&quot; title=&quot;【ruby】case文の使い方 - ya1:tech&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>2020-10-15 22:40:35</published>
  <title>【ruby】case文の使い方</title>
  <type>rich</type>
  <url>https://ya1teck.hatenablog.com/entry/2020/10/15/224035</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
