<?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>
  </categories>
  <description>再代入を回避させ、1回の記述で代入をさせるための記述を整理として 環境 検証したバージョン $ ruby -v ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c5) [arm64-darwin22] リファレンスマニュアルより if 式は、条件が成立した節(あるいは else 節)の最後に評価した式の結果を返します。else 節がなくいずれの条件も成り立たなければ nil を返します。 - 制御構造 (Ruby 3.3 リファレンスマニュアル) と記載されているので以下のように記述ができる。 gender = if is_male then &quot;male…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fshinkufencer.hateblo.jp%2Fentry%2F2024%2F10%2F12%2F000000&quot; title=&quot;Rubyはif文を使って代入する値を分岐した記述ができる - コード日進月歩&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>2024-10-12 00:00:00</published>
  <title>Rubyはif文を使って代入する値を分岐した記述ができる</title>
  <type>rich</type>
  <url>https://shinkufencer.hateblo.jp/entry/2024/10/12/000000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
