J
Jason Lillywhite
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.
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.