<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kamatimaru</author_name>
  <author_url>https://blog.hatena.ne.jp/kamatimaru/</author_url>
  <blog_title>delhi09の勉強日記</blog_title>
  <blog_url>https://kamatimaru.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>課題 Rubyでは、フィールド名＋=というメソッド名を定義することで、インスタンス変数への代入のような表現ができます。 以下のサンプルコードでいうと、def name=(name)がそれにあたります。 class Person def initialize(name) @name = name end def name=(name) @name = name end def introduce puts &quot;私の名前は#{@name}です&quot; end end p = Person.new(&quot;山田&quot;) p.introduce # 私の名前は山田です p.name = &quot;田中&quot; p.introduce…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkamatimaru.hatenablog.com%2Fentry%2F2025%2F10%2F26%2F202927&quot; title=&quot;Rubyの「=で終わるメソッド」が代入風に書けるのは言語仕様なのか？ - delhi09の勉強日記&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>2025-10-26 20:29:27</published>
  <title>Rubyの「=で終わるメソッド」が代入風に書けるのは言語仕様なのか？</title>
  <type>rich</type>
  <url>https://kamatimaru.hatenablog.com/entry/2025/10/26/202927</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
