Thufir Hawat
11/10/2007 12:25:00 AM
I've been working on this for quite some time and don't understand the
error:
C:\code>
C:\code>type monsters.rb
require 'Dragon'
require 'ArrayOfCreaturesAttributes'
require 'CreatureAttributes'
monsters[0]=ArrayOfCreaturesAttributes.instance
C:\code>
C:\code>type ArrayOfCreaturesAttributes.rb
require 'singleton'
require 'Creature'
require 'CreatureAttributes'
class ArrayOfCreatureAttributes < Array
include Singleton
end
C:\code>
C:\code>type Creature.rb
require 'CreatureAttributes'
class Creature
Creature.extend CreatureAttributes
include CreatureAttributes
end
C:\code>
C:\code>
C:\code>monsters.rb
C:/code/monsters.rb:6: undefined local variable or method `monsters'
for main:Ob
ject (NameError)
C:\code>