Monthly Archives: September 2010

Checking the existence of a super method in Ruby

Ruby gives methods the ability to call up to the superclass definition of themselves. Or it may not be a parent class definition; it might call up to a definition in a module included further up the ancestor chain. Either … Continue reading

Posted in Howto, Ruby | Tagged , , | Leave a comment

Determining Singleton Class Status in Ruby

Q: How do you tell if a given class is an ordinary class or a singleton class? A: Test whether the class is the first element in its own ancestor list. class NotASingleton self == ancestors.first # => true end … Continue reading

Posted in Howto, Ruby | Tagged , , , | 2 Comments

Off to Ruby DCamp

If you ‘re in the DC/NoVA region and you’ve always wanted to tell me what an idiot I am in person, now is your chance! I’ll be at Ruby DCamp over the weekend. I’ll probably be spending a lot of … Continue reading

Posted in Conferences | Tagged , , , , | Leave a comment

Do you use a Real Editor?

I’m not going to tell you which editor you should use (Emacs). I’m not trying to feed the editor wars (Emacs 4evar!!!!1!!). I do think that every programmer that cares about productivity should use a Real Editor, though. I’ve thought … Continue reading

Posted in Tools | 27 Comments

Class Methods Considered Annoying

Challenge: given the following class, write a method #find_like_objects which will call the class method .find with attributes. class Foo attr_reader :attributes def initialize @attributes = { :bar => 42 } end def self.find(attributes) “Foo.find” end end Simple enough: class … Continue reading

Posted in Ruby | 13 Comments

I don’t care about your corporate perks

As my regular readers know, I’ve been a freelancer for around half a year now. Lately I’ve been thinking about what it would take to entice me back into full-time employment. Here’s what I came up with. I don’t care … Continue reading

Posted in Rants | Tagged | 17 Comments