<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Sixeight</author_name>
  <author_url>https://blog.hatena.ne.jp/Sixeight/</author_url>
  <blog_title>ちなみに</blog_title>
  <blog_url>https://blog.nishimu.land/</blog_url>
  <categories>
    <anon>ruby</anon>
  </categories>
  <description>Rubyの初級テクニック*1であるModule#module_evalですが、初級者には厳しい落とし穴がありました。 ただし、ローカル変数は module_eval/class_eval の外側のスコープと共有します。文字列が与えられ場合には、定数とクラス変数のスコープは自身のモジュール定義式内と同じスコープになります。ブロックが与えられた場合には、定数とクラス変数のスコープはブロックの外側のスコープになります。 502 Bad Gateway ローカル変数は良いとして、定数とクラス変数はひどい。 文字列もブロックも一緒だろってことで、１行は文字列、複数行はブロックにしてたけど、ブロックだとた…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.nishimu.land%2Fentry%2F20081211%2F1229012685&quot; title=&quot;Module#module_eval(class_eval)の落とし穴 - ちなみに&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>2008-12-11 01:24:45</published>
  <title>Module#module_eval(class_eval)の落とし穴</title>
  <type>rich</type>
  <url>https://blog.nishimu.land/entry/20081211/1229012685</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
