<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nkgt_chkonk</author_name>
  <author_url>https://blog.hatena.ne.jp/nkgt_chkonk/</author_url>
  <blog_title>猫型の蓄音機は 1 分間に 45 回にゃあと鳴く</blog_title>
  <blog_url>https://nekogata.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>モジュールに特異メソッドを定義する方法はいろいろあるけど、それぞれ違いがあるのでまとめた。 普通にメソッドとして定義しておいて、あとから extend self するというちょっとトリッキーなやりかた。 mitukiii のひとが使ってるの見て知った module_function を使うやり方。これも mitukiii の人経由で知った。 普通に class &lt;&lt; self で特異クラスをオープンしてそこに定義するやりかた。 def self.some_method のやり方は普通なので今回は取り上げない。 extend self するやり方だと、そのモジュールをincludeしたクラスに対…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnekogata.hatenablog.com%2Fentry%2F2012%2F11%2F29%2F220213&quot; title=&quot;Rubyのモジュールの特異メソッド定義する方法いろいろ - 猫型の蓄音機は 1 分間に 45 回にゃあと鳴く&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>2012-11-29 22:02:13</published>
  <title>Rubyのモジュールの特異メソッド定義する方法いろいろ</title>
  <type>rich</type>
  <url>https://nekogata.hatenablog.com/entry/2012/11/29/220213</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
