+----------------------------------------------------+
| class A                                            |
|  def initialize; puts "class A"; end               |
|  class B                                           |
|    def initialize; puts "class B"; end             |
|    def test_b; puts "instance method in B"; end    |
|  end                                               |
|  def make_b; B.new; end                            |
| end                                                |
|                                                    |
| a = A.new                                          |
| b = a.make_b                                       |
| b.test_b                                           |
+----------------------------------------------------+

OUTPUT:
  class A
  class B
   instance method in B

-- 
Posted via http://www.ruby-forum.com/.