<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>te-nu</author_name>
  <author_url>https://blog.hatena.ne.jp/te-nu/</author_url>
  <blog_title>ウェブエンジニア珍道中</blog_title>
  <blog_url>https://www.te-nu.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>Rubyでクラスを作って色々処理を書いていると、セッターメソッド周りで意図しない挙動をしたりRubocop（静的コード解析ツール）に「冗長なselfつけんじゃねーよ」と怒られたりしたのでまとめます。 問題 問題のコードはこちらです、ギターをクラス化してみました。僕の趣味です。 class Guitar attr_accessor :color def initialize color = '赤' end def say_color &quot;このギターは #{color} やで！&quot; end end では色を表示してみましょう。 guitar = Guitar.new puts guitar.color…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.te-nu.com%2Fentry%2F2017%2F02%2F26%2F180550&quot; title=&quot; Rubyのセッターメソッドとレシーバとselfの話 - ウェブエンジニア珍道中&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>https://images-fe.ssl-images-amazon.com/images/I/5186AWFoSXL._SL160_.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-02-26 18:05:50</published>
  <title> Rubyのセッターメソッドとレシーバとselfの話</title>
  <type>rich</type>
  <url>https://www.te-nu.com/entry/2017/02/26/180550</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
