From: Aldric Giacomoni Date: 2010-03-31T21:23:23+09:00 Subject: Re: Ruby Koans: will this method ever return :empty? Aldric Giacomoni wrote: > Steve Kim wrote: >> Is it possible to have this method return :empty? > > class MessageCatcher > def add_a_payload *args > args.empty? :empty : args > end > end > > args.empty? [:empty] : args > I'd appreciate it if no one mentioned that I forgot the '?' twice! I am so ashamed. args.empty? ? :empty : args args.empty? ? [:empty] : args -- Posted via http://www.ruby-forum.com/.