work one out for yourself there
In an American movie, a husband is trying to have sex with his wife, but it's late and she says she's not in the mood.
Husband: Come on, baby doll. It's been a long time. We both need it.
Wife: I don't just have some switch.
(he imitates switch-flicking)
Wife: That's disrespectful.
Husband: Come on now, I'm just playing with you.
Wife: Why don't you just, you know, work one out for yourself there, darling?
I tried my best, but still can't get what the ONE means in the context above. Could you, please, tell me whether it refers to anything mentioned in the dialogue or is it merely implied? In any case, I would be really grateful if you would explain it to me, please.