From: sl4m Date: 2010-04-01T00:36:55+09:00 Subject: Re: Ruby Koans: will this method ever return :empty? --0016e647ecc4bb78b004831a83b2 Content-Type: text/plain; charset=ISO-8859-1 Thanks guys! It looks like there's a mistake in the koans then. I'll report it to the author. I ran this piece of code over and over on irb, but could not figure it out. Cheers, skim On Wed, Mar 31, 2010 at 05:23, Aldric Giacomoni wrote: > 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/. > > --0016e647ecc4bb78b004831a83b2--