< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Hi,
I am stuck in some constant lookup behavior and I would really
appreciate if someone could enlighten me what is going on. Here is the
example:
<snippet>
class A
class << self
class B
end
def testme1
puts B # prints #<Class:0xac6598>::B
end
end
def self.testme2
puts B # raises a NameError
end
end
A.testme1
A.testme2
</snippet>
I do not understand why those two class methods behave differently
depending on how they were defined. It looks very confusing to me. Or is
there an important reason for that? How does the constant lookup work in
both examples?
Thanks for your help.
Best regards,
Tilman