Sometimes, the little things count
Posted by Erik Peterson on 04/28/2008 18:36
class TrueClass
  def to_exclamation
    "Yes"
  end
end

class FalseClass
  def to_exclamation
    "No"
  end
end

(1+2 == 3).to_exclamation
=> "Yes"
(1+1 == 4).to_exclamation
=> "No"

This demonstrates two things:

  1. Small things can matter. Even something that is seemingly inconsequential can turn into something pleasant.
  2. Just because something (IE monkeypatching) can be harmful, doesn't mean it always is.