[Wtr-development] element.to_s instead of element.show

Alan Baird abaird at bairdsnet.net
Fri Oct 1 22:52:56 EDT 2010

>The show methods were quite handy before there were tools like firebug. Now
I never use them any more. Does any one?

I don't use the show methods, but the .to_s methods come in handy.  Here is
my use case.  Suppose you need to get some specific divs and you do
something like:

important_divs = @br.divs.select{|div|

Now, if I'm in irb, I might test this out to see if the important_divs are
really the ones I'm looking for, and the implementation of .to_s currently
lists the id and other important attributes.  It's not clear in your
proposal if this would stop working like this and instead I would get the
normal ruby class name syntax.  If this is the case, this would be less
functional and would cause me to do more work to iterate through
important_divs to check them out and see if they were what I wanted.  IE Dev
toolbar and Firefox don't help here because I'm using it to debug my program
in irb.

We don't have to do any work to keep the .to_s methods do we?  If not, why
should we remove them if they are useful for some and not harmful to others?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/wtr-development/attachments/20101001/69b03308/attachment.html>

More information about the Wtr-development mailing list