Changes

Jump to: navigation, search

Ruby Methods

32 bytes added, 15:01, 19 March 2009
m
Passing Arguments to a Method
</pre>
<google>ADSDAQBOX_FLOW</google>
In this example, the method is called multiple times, passing through arguments that are then used in the method to perform a calculation on the arguments, displaying the result. To achieve this without methods it would be necessary to repeat the code in the method 4 times over. Clearly, placing the code in a method and re-using it over and over is a much more efficient approach.

Navigation menu