Question: I want to do some validation whenever the value of a textfield changes. I don't see an on change event mentioned in the documentation though.

Answer: 
<http://ruby-doc.org/core/classes/Marshal.html>
You're editing the class on the fly, and you want to save that? You could try using the Marshal module, it'll allow you to save objects to a file, and read them back in memory dynamically.