I
Ibon Castilla
Hi there:
I was learning about methods, and when I was trying to use optional
arguments I get stucked with this:
def my_method (a='This', b='is', c='great')
puts a+' '+b+' '+c
end
If I try:
my_method('Ruby')
-> Ruby is great
-> nil
But if I try:
my_method(,,'cool')
-> SyntaxError: compile error
Any idea on how to use arguments different from the first one?.
Thank's in advance, Ibon.
I was learning about methods, and when I was trying to use optional
arguments I get stucked with this:
def my_method (a='This', b='is', c='great')
puts a+' '+b+' '+c
end
If I try:
my_method('Ruby')
-> Ruby is great
-> nil
But if I try:
my_method(,,'cool')
-> SyntaxError: compile error
Any idea on how to use arguments different from the first one?.
Thank's in advance, Ibon.