On Nov 7, 5:16 pm, "ara.t.howard" <ara.t.how... / gmail.com> wrote:
> cfp: ~> cat a.rb
>
> class Creature
>    Children = []
>
[snip]
> end

As an off-topic aside, I really like what you've done here. Normally I
do things like this:

class Foo
  @all = []
  class << self
    attr_reader :all
  end
  def initialize
    self.class.all << self
  end
end

...but I've now seen the light how a constant scoped to the class can
make life far simpler.

class Foo
  ALL = []
  def initialize
    ALL << self
  end
end

There's even some interesting benefits to the scoping, like:

# By inheriting the superclass's initialize,
# Bar1 instances get put into Foo::ALL
class Bar1 < Foo; end

# But I can totally branch on my own without worrying about
# any class variable sort of nonsense
class Bar2 < Foo
  ALL = [] # separate from Foo::ALL
  def initialize
    ALL << self
  end
end

Thanks for that, Ara!