Re: Data for eigenclass



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!"

.



Relevant Pages

  • Command Line Outlook switches (XP)
    ... I want to attach more than one file to an Outlook XP email message using the ... command line switch "/a" but I can't find syntax to attach more than one ...
    (microsoft.public.office.developer.automation)
  • "ifconfig -vlandev" syntax
    ... inconsistencies sneak into their syntax. ... -vlandev takes a useless argument cannot attach to more ...
    (freebsd-current)
  • "ifconfig -vlandev" syntax
    ... inconsistencies sneak into their syntax. ... -vlandev takes a useless argument cannot attach to more ...
    (freebsd-net)
  • Re: A better way of making subsclassing of built-in types stick for attributes?
    ... you're instantiating a 'str' object, since that's what the syntax ... Because you haven't created an object of that subclass. ... behaviour *inherited from* the original class. ...
    (comp.lang.python)
  • Data for eigenclass
    ... How do I set data at the eigenclass level (data should basically be ... And the @my_data syntax attach ...
    (comp.lang.ruby)