<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>sshi</author_name>
  <author_url>https://blog.hatena.ne.jp/sshi/</author_url>
  <blog_title>sshi.Continual</blog_title>
  <blog_url>https://sshi.hatenadiary.org/</blog_url>
  <categories>
    <anon>ruby</anon>
  </categories>
  <description>rubyリングにも参加したことでもあるし、今日はrubyネタ。 「Pythonでのメタクラス・プログラミング」(http://www-06.ibm.com/jp/developerworks/linux/030425/j_l-pymeta.html)を読んで、ふと「Rubyでメタっぽいことやったらどこまで出来るかなあ」と思ったので、いろいろ試してみた。結局、文字列をevalすることもなく、def構文もclass構文もmodule構文も使うことなく、動的にクラスを生成できるところまで行き着いたのでご紹介。メタなしかけの説明は後にして、まずはサンプル。こんなコードが書けるようになる。</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsshi.hatenadiary.org%2Fentry%2F20051111%2Fp1&quot; title=&quot;defもclassもmoduleも使わないrubyメタプログラミング - sshi.Continual&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>2005-11-11 00:00:00</published>
  <title>defもclassもmoduleも使わないrubyメタプログラミング</title>
  <type>rich</type>
  <url>https://sshi.hatenadiary.org/entry/20051111/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
