From: Robert Klemme Date: 2009-04-16T19:52:43+09:00 Subject: Re: returning value from ternary operator 2009/4/16 Sijo Kg : > Hi >     I have > >    def get_company_details_array >    c = nil >    arr = [] if c.nil? >    c.nil? ?  2.times {arr.push("")} :['a','b'] >  end What weird logic is that? Basically you can replace the method with def get_company_details_array ['',''] end >  arr = ['abc'] + get_company_details_array >  puts arr.inspect > >   What I expected here is ["abc","",""]   But I am getting error > array.rb:7:in `+': can't convert Fixnum into Array (TypeError) >        from array.rb:7 > >         Could anybody please correct the code? Hint: Fixnum#times returns the number. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/