It has an opening for gambling (4,7)

I believe the answer is:
slot machine
'gambling' is the definition.
Although both the answer and definition are singular nouns, I cannot see how they can define each other.
'it has an opening' is the wordplay.
'it' becomes 'machine' (I can't explain this - if you can you should believe this answer much more).
'has' is a charade indicator (letters next to each other).
'an opening' becomes 'slot' (slot is a kind of opening).
'machine' after 'slot' is 'SLOT-MACHINE'.
'for' is the link.
Can you help me to learn more?
(Other definitions for slot machine that I've seen before include "One-armed bandit" , "Coin-fed device" , "2 8 [CASINO GAME]" .)
