Ruby provides syntax for a !! boolean. In this example let’s extend this to a class default for our Yummy class.

class Yummy

  def initialize
    @dinner_defined = false
  end

  def some_fudz
    !!@dinner_defined
  end

end

y = Yummy.new
puts y.some_fudz
#=> false

Leave a Reply

Screen Shot 2013-12-08 at 9.49.35 PM

I have helped a dozen companies build and optimize their engineering teams to deliver great products.

Let’s work together and I can align your business needs with your technology initiatives.