I am looking for a good analogy to help the concept of a method in ruby stick in my head. When I truly understand a concept, an image flashes in my mind that relates something physical to the abstract concepts I am trying to learn.
For example, someone explained the concept of a variable to me in the following way:
A variable is like a box you can put things in. The name of the variable is like taking a sharpie and writing a word, like "forks" on the side of the box. Picking a good name is important. You can stick anything in the box, but if you write 'forks' on the side of the box, you would expect forks to be in the box. You can put anything in the box, then carry it around to various people, and tell them "there are forks in this box." When they need a fork, they go to the fork box and get out a fork.
That's the sort of physical, image-based, concrete analogy I am looking for for a ruby method.
Right now most definitions I have found are useless to me. For example, at turtorialspoint, the first result for the google search 'what is a ruby method,' has the folowing definition.
Ruby methods are very similar to functions in any other programming language. Ruby methods are used to bundle one or more repeatable statements into a single unit.
Let me give you an example of why this definitions is useless to me. I'm going to replace every word and concept in this definition that I don't understand with the word 'blah.'
Ruby blah are very similar to blah in any other programming language. Ruby blah are used to blah one or more blah blah into a single blah.
In summary, can I get a good, physical analogy for the concept of a method in ruby?