A question about big projects and classes within classes

I am trying to teach myself Ruby. So i have decided to make an RPG
Sword and sorcery type. my question is can classes contain classes.

for example

Module World
class Map
class Make_land
def landmass
# generate land mass, mountain ranges, etc.
end
end
class Make_Seas
#generate ocean and lakes
end
#etc ad infinitum
end

August0866 wrote:

my question is can classes contain classes.

Yes, they can.

    #etc ad infinitum

end

Yes, that’d work.

HTH,
Sebastian

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs