Books
Tell me to whom you are addressing yourself when you say that. I am addressing myself--I am addressing myself to my cap.
— Molière • L'Avare

Behind the line May contain spoilers.
Our reading
An editorial interpretation.
Someone demands to know who's being spoken to, and the reply is a cap. It's a quick dodge that turns a hat into the listener. The comedy comes from the speaker escaping blame with an absurd, face-saving excuse.
Context reviewed