Synecdoche from Greek, sunekdokhe, "to take out." This is the familiar "part for the whole." When the captain bellows, "All hands on deck!" he expects more than the hands to show up. A rancher who has a thousand head of cattle is not just interested in the heads. Some outdated slang, "Nice threads," "Nice wheels," are also forms of synecdoche, as is "giving your hand in marriage." This is a type of metonymy because it is a form of meta-name, calling something not by its own name, but the name of some related aspect. There is a difference between synecdoche and metaphor, however. If you tell someone, "Get your ass over here," that's synecdoche. If you call someone an ass, that's metaphor.
In the old days, teachers used to distinguish a certain type of synecdoche as "the container for the thing contained." "The White House said today..." "He drank the entire cup and then ate the whole bowl." James Thurber reversed this, pointing out sometimes we use the thing contained to signify the container.
Woman to Husband in Grocery Store: "If you don't stop that, I'm going to hit you with the milk."