News for hackers. Stuff that matters.
Re:Why teach with Ruby? by gmac on Thursday October 14, 2010 @03:46PM (#1792299)
I figured that Ruby must have similar functionality to Python's dir()

Sounds like you wanted

   'x'.methods
    => [:<=>, :==, :===, :eql?, :hash, :casecmp, ... ]
or the more focused

   'x'.methods - Object.methods
    => [:casecmp, :+, :*, :%, :[], ... ]

?
Re:Why teach with Ruby? by jrheard on Thursday October 14, 2010 @08:12PM (#1793180)
Yup - that's exactly what I was looking for. Awesome.
Re:Why teach with Ruby? by rb2k_ on Friday October 15, 2010 @07:42AM (#1794254)
The question is why Python calls it "dir" when you just want to see a list of the object's methods...