Todd Benson wrote: > On Mon, Aug 4, 2008 at 10:24 PM, Marcio Braga <mbraga0001 / gmail.com> > wrote: >> undefined method '[]=' for Matrix[[11, 12], [21, 22]]:Matrix >> (NoMethodError) > > You have to open the class and define the method as in the example... > > class Matrix > def []=(i, j, x) > @rows[i][j] = x > end > end > > Todd Perfect! Thank you. Quick comment: Why this method is not already pre-defined in the Matrix class ? -- Posted via http://www.ruby-forum.com/.