From: 7stud -- Date: 2011-08-24T21:31:29+09:00 Subject: Re: "args = nil" in method signature Michelle Pace wrote in post #1018189: > Hello, please could somebody explain to me what the "args = nil" in the > method signature does? And why/when would you use such a convention? > def my_meth(args=nil) if args args.each do |k, v| puts "#{k}: #{v}" end else puts "goodbye" end end my_meth(a: "hello", b: "world") my_meth() --output:-- a: hello b: world goodbye -- Posted via http://www.ruby-forum.com/.