<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>takapi86</author_name>
  <author_url>https://blog.hatena.ne.jp/takapi86/</author_url>
  <blog_title>takapiのブログ</blog_title>
  <blog_url>https://takapi86.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>最近は、空いた時間にRuby認定試験（Gold）の対策をやっているのですが、 本を読んでいてわかった気になっていた箇所がまぁ、多いこと。。。 練習問題をやってみると、そのへんがはっきりをわかるので良いです。 今回はかなり基本的なことなのですが、定数参照について頭を整理するためにまとめていこうと思います。 Rubyの定数を参照する順番 レキシカルスコープの探索 -&gt; クラス探索 の順番で探索します。 例えば、以下の場合は、CONST_A が表示されます。 class A NAME = &quot;CONST_A&quot; def name NAME end end class B &lt; A NAME = &quot;CONS…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakapi86.hatenablog.com%2Fentry%2F2018%2F06%2F10%2F225801&quot; title=&quot;Rubyの定数参照について頭を整理した - takapiのブログ&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>2018-06-10 22:58:01</published>
  <title>Rubyの定数参照について頭を整理した</title>
  <type>rich</type>
  <url>https://takapi86.hatenablog.com/entry/2018/06/10/225801</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
