Hi everybody,


I have this:


class Fixnum
   def times_print(str)
      times { puts str }
   end
end




module Bb
  def self.test
    10.times_print('foo')
  end
test
end

It works..

But if some other .rb uses the same name for its Fixnum class extension,
including different methods, there will be collision ??



So I tried to wrap my class extension in a module like this:


module Aa
  class Fixnum
    def times_print(str)
      times { puts str }
    end
  end
end



module Bb
include Aa
  def self.test

    10.times_print('foo')
  end
test
end

The class-extention in module Bb does not work, how do I solve this>??

Thnx!!

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