Take a look at Design Patterns: http://en.wikipedia.org/wiki/Design_Patterns
or more specifically the "four horsemen" book: 
http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612/ref=sr_1_1?s=books&ie=UTF8&qid=1393447423&sr=1-1&keywords=design+patterns

Or more ruby specifc:
http://www.amazon.com/Practical-Object-Oriented-Design-Ruby-Addison-Wesley-ebook/dp/B0096BYG7C/ref=sr_1_2?s=books&ie=UTF8&qid=1393447456&sr=1-2&keywords=rails+design+patterns

Those have been super helpful to me, and many other code slingers.  To that
end, I think you are taking the wrong architectural approach, but it's 
great that you are giving it a go!

-c




On Wed, Feb 26, 2014 at 09:20:36PM +0100, Paul Robinson wrote:
> Thanks Craig, I'm trying to write a very simple game; I realise that 
> Ruby isn't the right vehicle for writing games (!) but hopefully it will 
> help me learn Ruby and have some fun along the way. I've got a 'world' 
> object and a 'player' object which have very different attributes and 
> methods but each may need to access the information contained in the 
> other, for example the player might only move in a certain direction 
> depending upon where he is in the world.
> 
> Chris, I think that may be way to go, i.e. creating the player object 
> within the world object (sounds logical too!) - I've never done anything 
> like that before but a quick search shows that such nested or inner 
> classes might be just right.
> 
> Thanks both,
> 
> Paul
> 
> -- 
> Posted via http://www.ruby-forum.com/.