[ruby-it] Come aggiungere un metodo alla classe String?

Sam Pei tex---74 a libero.it
Lun 17 Nov 2008 08:20:16 CET


Salve a tutti

Vorrei aggiungere un metodo "mio_metodo" alla classe String, in modo da
poter fare qualcosa tipo:

str = "Mia Stringa".mio_metodo

Perciņ nel controller ho messo:

class String
  def mio_metodo

  end
end

Ma non funziona.

Come si fa?

Grazie a tutti.
-- 
Posted via http://www.ruby-forum.com/.


More information about the Ml mailing list