From: Junayeed Ahnaf Nirjhor Date: 2011-11-14T20:51:31+09:00 Subject: Noob question regarding custom method --------------040300050207040706070603 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello, I am still learning ruby. My question is, often we see things like this: def set_miles(miles) @miles = miles end Here, we're defining a custom method set_miles , then passing it an argument (what's the reason of doing so?), then we're setting the instance variable @miles to a local variable miles, why's that for? I know I can use attr_accessor but things like this occurs in various place. What's the point of doing this? I know I sound funny but i can't understand. Any help would be much much much appreciated. -- Junayeed Ahnaf Nirjhor /Doing this and that/ http://twitter.com/nirjhor --------------040300050207040706070603--