<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>rubyco</author_name>
  <author_url>https://blog.hatena.ne.jp/rubyco/</author_url>
  <blog_title>rubyco（るびこ）の日記</blog_title>
  <blog_url>https://rubyco.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>数に対して特異メソッドを定義しようとすると構文解析エラーになりました。 def 1.hello puts &quot;Hello&quot; end #=&gt; parse error, unexpected tINTEGER構文解析エラーを回避するためカッコをつけたら、リテラルに特異メソッドは定義できないと言われました。 def (1).hello puts &quot;Hello&quot; end #=&gt; can't define singleton method for literalsいったん変数に入れてから定義したら、Fixnumに特異メソッドは定義できないと言われました。 s = 1 def s.hello puts &quot;H…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Frubyco.hatenadiary.org%2Fentry%2F20060307%2Fsingletonmethod&quot; title=&quot;特異メソッド - rubyco（るびこ）の日記&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>2006-03-07 00:00:04</published>
  <title>特異メソッド</title>
  <type>rich</type>
  <url>https://rubyco.hatenadiary.org/entry/20060307/singletonmethod</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
