<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>chamotarooo</author_name>
  <author_url>https://blog.hatena.ne.jp/chamotarooo/</author_url>
  <blog_title>chamotaroooのブログ</blog_title>
  <blog_url>https://chamotaro.hatenablog.com/</blog_url>
  <categories>
    <anon>技術</anon>
  </categories>
  <description>先に結論を書く。 Ruby の &amp;.（ぼっち演算子）は、左側が nil のときだけ、メソッド呼び出しを飛ばして nil を返す。 エラーを避けるには便利だが、nil が来た理由は消えない。 使いどころを間違えると、nil が静かに奥へ流れて、別の場所で原因の分からない不具合になる。 何をする演算子か Ruby の公式ドキュメントでは、&amp;. は「レシーバが nil のときにメソッド呼び出しを飛ばせる」ものと説明されている。 飛ばしたときは nil を返し、引数の式も評価しない。 出典: Ruby 公式ドキュメント: Calling Methods Ruby 3.2.4 で確かめた。 User =…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fchamotaro.hatenablog.com%2Fentry%2Ftech%2Flonely-operator&quot; title=&quot;ぼっち演算子 &amp;amp;. は nil を黙らせるが、nil の原因は消さない - chamotaroooのブログ&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>2026-10-05 16:17:20</published>
  <title>ぼっち演算子 &amp;. は nil を黙らせるが、nil の原因は消さない</title>
  <type>rich</type>
  <url>https://chamotaro.hatenablog.com/entry/tech/lonely-operator</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
