In Ruby, you may need to coerce an expression to an explicit boolean value.

This:

 b = defined?(foo) ? true : false

becomes:

b = !!defined?(foo)

That is a double not (!) operator.

irb(main):001:0> !!false
=> false
irb():002:0> !!nil
=> false
irb(main):003:0> !!true
=> true
irb(main):

http://rubyrogues.com/032-rr-ruby-antipatterns/