what the !!
Have you ever seen something like this?
def logged_in?
!!@current_user
end
This is used to convert value to boolean. Use this if you want to be strict with the ruby conventions about the boolean methods.
Written by Hrvoje Šimić
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#