Ruby Method Parameters & Arguments
Ruby Method Splat
Ruby Block Parameter
Ruby Sort Method
Ruby Combined Comparison Operator
def greeting puts "Hello world!" end #In this example, the first line or header contains the keyword "def" and the method name. puts "Hello world!" is within the body of the method, which describes the certain task that the method carries out. It is also indented two spaces by convention. Following the body, the method ends with the end keyword.
A Ruby method is a reusable section of code written to execute a certain task. It is defined with the
def keyword, followed by a method name, a method body, and ends with the