<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>rightgo09_ruby</author_name>
  <author_url>https://blog.hatena.ne.jp/rightgo09_ruby/</author_url>
  <blog_title>【旧】PerlerのRuby日記-&amp;gt;はてなブログに移行しました</blog_title>
  <blog_url>https://rightgo09-ruby.hatenadiary.org/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>へぇと思ったのでメモ。親クラスで定義された定数は、子クラスにも継承されて修飾なしで参照できる。 クラス名も定数なので、それも出る。 class Hoge ABC = 123 class Fuga end end class Foo &lt; Hoge p constants #=&gt; [:ABC, :Fuga] end なんだか変な感じである。 また、 Foo → Hoge ｜ ｜ Foo::Bar → Hoge::Barこういうクラスを作ろうとすると、以下のようになる。 class Hoge class Bar end end class Foo &lt; Hoge class Bar &lt; Bar # 左…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Frightgo09-ruby.hatenadiary.org%2Fentry%2F20130112%2Fp1&quot; title=&quot;子クラスには定数も継承される - 【旧】PerlerのRuby日記-&amp;amp;gt;はてなブログに移行しました&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>2013-01-12 00:00:00</published>
  <title>子クラスには定数も継承される</title>
  <type>rich</type>
  <url>https://rightgo09-ruby.hatenadiary.org/entry/20130112/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
