Double "!!" in Ruby [closed]
- by Alex Maslakov
Possible Duplicate:
What does !! mean in ruby?
Ruby, !! operator (a/k/a the double-bang)
Sometimes I see a Ruby code like this
def sent?
!!@sent_at
end
It seems to be not logical. Is it necessary to use here double !? As far as I'm concerned, it might be just
def sent?
@sent_at
end
UPDATE: then what is the difference between these
def sent?
!!@sent_at
end
def sent?
@sent_at.nil?
end
def sent?
@sent_at == nil
end