It might sound too obvious but I failed to find any examples on usual guides or any help via stackoverflow
I looked up the code on api.rubyonrails.org and found that it calls two different methods. After following the train of code, I found that following piece of code will work:
def logged_in?
request.authorization ? true : false
end