From: incag neato Date: 2012-08-18T02:37:58+09:00 Subject: Re: Default parameters? + (Noob) Guidance > Default arguments are declared with an assignment like this > > def say_hello(name = "nobody") > "Hello, #{name}." > end Thanks so much Robert! Gotcha. The issue I'm confused with is accounting for both:- setting the default value (for when no parameter is passed) and also accepting an input. I.e. --> returns "Hello, Master." when say_hello("Master") is called ✔ Error: returns "Hello, Qui-Gon Jinn." when say_hello is called with no parameters Error: wrong number of arguments (0 for 1) Do I use something like a conditional? Something more like the below? def say_hello(name) if say_hello? "Hello, #{name}." else "Hello, Qui-Gon Jinn." end end Not sure which approach to take. -- Posted via http://www.ruby-forum.com/.