simple Ruby Class confusing and debugging
===

I'm trying to follow a lesson with the ruby class below, I just don't understand how the results of the output statement is "John Smith" from calling the player function followed by new variable?

Is there any simpler way for this? the coder did it in a way that i got confused
Lastly, Can you tell me how to debug Ruby Class or any ruby code on TextMate? I mean debug just like debugging in Visual C++ shows me what first line gets called and excauted and then jumps to the next etc... to see how it works?

    class Dungun
      attr_accessor :player 
    
    def initialize(player_name)
      @player = Player.new(player_name)
      @rooms = []
    end
    
    
    class Player
      attr_accessor :name, :location
      def initialize(player_name)
        @name = player_name
      end
    end
    
    class Room
      attr_accessor :reference, :name, :description, :connection
      def initialize(reference,name,description,connection)
        @reference = reference
        @name = name
        @description = description
        @connection = connection
        
      end
    end
    end
    
    my_dungun = Dungun.new("John Smith")
    puts my_dungun.player.name

  
 