From: "Victor H. Goff III" Date: 2009-01-24T15:19:18+09:00 Subject: Re: with or without arguments - how? --0016363b7e9c43c83f04613483a5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Try this: my_method(x = 1, y = 1) x + y end Warmest Regards, Victor H. Goff III On Fri, Jan 23, 2009 at 11:01 PM, Jason Lillywhite < jason.lillywhite@gmail.com> wrote: > I've used methods before that work with or without arguments. I've tried > to figure it out but can't get to the bottom of it. Could someone give > me a hint how you would go about creating a method that works for either > of these cases? > > mymethod(x, y) > x + y > end > > Then somehow get this to work without the (x, y) arguments...? What I > want is to have a method that can do something on default if no > arguments are spec'd or I can refine what it does by adding arguments. > -- > Posted via http://www.ruby-forum.com/. > > --0016363b7e9c43c83f04613483a5--