Gavin Sinclair (in "Comments on matrix.rb") wrote:

> Matrix:
>  - initialize should be protected/private

It already is:

  irb(main):001:0> m = Matrix[[1,0,0], [0,1,0], [0,0,1]]
    ==> Matrix[[1, 0, 0], [0, 1, 0], [0, 0, 1]]

  irb(main):002:0> m.initialize
  NoMethodError: private method `initialize' called for 
    #<Matrix:0x40402a88> from (irb):2

I believe the 'initialize' method of any class is private by default:

  irb(main):003:0> class Foo
  irb(main):004:1>   def initialize
  irb(main):005:2>   end
  irb(main):006:1> end
    ==> nil

  irb(main):007:0> f = Foo::new
    ==> #<Foo:0x403f9e9c>

  irb(main):008:0> f.initialize
  NoMethodError: private method `initialize' called for 
    #<Foo:0x403f9e9c> from (irb):8


-- 
Michael Granger <ged / FaerieMUD.org>
Rubymage, Believer, Architect
The FaerieMUD Consortium <http://www.FaerieMUD.org/>