It's a type of metaphor, in which parts stand for wholes, or vice versa.
Examples ripped from wikipedia
- Fill him full of lead.
- The smack of leather on willow
- The gray-beard and the long-hair
- The city posted a sign
- Put it on plastic
- A fresh pair of hands
- What sort of coke do you have?