<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ztbuz</author_name>
  <author_url>https://blog.hatena.ne.jp/ztbuz/</author_url>
  <blog_title>ztbuz@dev</blog_title>
  <blog_url>https://ztbuz.hateblo.jp/</blog_url>
  <categories>
  </categories>
  <description>Rubyには、以下のような書き方があるらしいです。 a ||= b これはor equal演算子と呼ぶらしいのですが、これについて動きなどを調べてみたのでメモします。 or equal演算子について コード例 以下のコードについて、or_equal(name)の部分がそれにあたります。 これはつまり、インスタンス変数@nameが存在すればそれを返し、なければ引数のnameを返す、という動きになります。 class Foo def name=(name) @name = name end def or_equal(name) @name ||= name end end インスタンス変数がない場…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fztbuz.hateblo.jp%2Fentry%2F2013%2F12%2F29%2F031918&quot; title=&quot;Rubyのor equal演算子の使い方 - ztbuz@dev&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>2013-12-29 03:19:18</published>
  <title>Rubyのor equal演算子の使い方</title>
  <type>rich</type>
  <url>https://ztbuz.hateblo.jp/entry/2013/12/29/031918</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
