On Tue, Jan 4, 2011 at 9:00 PM, timr <timrandg / gmail.com> wrote:

> class Object
>  def singleton_class?
>    self.singleton_methods.length == 0 ? false : true
>  end
> end
>

Really small point here, and not really on topic, but this is a little
around the houses and can be slightly improved:

class Object
  def singleton_class?
    !self.singleton_methods.empty?
  end
end

Or just != 0, since it'll return the true/false without the need for a
ternary.