More of a blurb than a full post, and probably does not deserve the front page - but I need to update the site. I have been working on a file upload class and a few other additions to a small project my friend and I are hacking away at. During this project I discovered (although I should have known this great feature of Ruby long before... tsk tsk):
At any point you can use the .class method to find out what class an object is (and considering that everything is an object in Ruby - this is extremely helpful). In my case a file I uploaded - I wanted to determine its class (due to a comment I received on one of my other posts), so I placed <%= uploadfile.class %> into my view and it spat out the class.
I was expecting File - but discovered that it was in fact of the class Tempfile (this had already been pointed out to me, but I wanted to see for myself). What a great tool! Not only can you find out the class - you can also discover an objects methods and instance_variables with similar syntax.
Way to go Ruby, making my job that much easier.
