Ruby method prevent us from writing the same code in a program again and again. Ruby methods are similar to functions in other languages.