Re: Data for eigenclass
- From: Thomas Wieczorek <wieczo.yo@xxxxxxxxxxxxxx>
- Date: Wed, 6 Feb 2008 04:19:53 -0500
On Wed, Feb 6, 2008 at 10:05 AM, Jari Williamsson
<jari.williamsson@xxxxxxxxxxxxxxxxxx> wrote:
The @@my_data syntax seems to attach only to the original class in which
it was defined, not for any subclasses. And the @my_data syntax attach
to each instance.
I am not sure if I understand you. Class variables(@@bar) are
available for its children:
(in irb)
class Foo
@@foo = "Yeehaaw!"
end
class Bar < Foo
def initialize
puts @@foo
end
end
Bar.new=> "Yeehaaw!"
.
- Follow-Ups:
- Re: Data for eigenclass
- From: Alexandru E. Ungur
- Re: Data for eigenclass
- References:
- Data for eigenclass
- From: Jari Williamsson
- Data for eigenclass
- Prev by Date: Re: Regexp matching in a block of code
- Next by Date: Re: Strange characters... how are they created?
- Previous by thread: Data for eigenclass
- Next by thread: Re: Data for eigenclass
- Index(es):
Relevant Pages
|