From: Basant Dewangan Date: 2011-02-10T17:50:01+09:00 Subject: Re: Ruby coding help hi Tridib, Ruby methods : It provides a way to organize code and promote re-use. Rather than create long sections of Ruby code, the code is instead organized into logical groups that can be called when needed and re-used without having to re-write the same code over and over. Methods are simple to use, in fact you only need to do two things with a method, declare it and call it. How to declaring and Calling a Ruby Method The syntax of a Ruby method is as follows: def name( arg1, arg2, arg3, ... ) .. ruby code .. return value end The name specifies how we will refer to this method when we call it. The args specify values that are passed through to the method to be processed. The ruby code section represents the body of the function that performs the processing. The optional return statement allows a value to be returned to the section of code which called the method. -- Posted via http://www.ruby-forum.com/.