From: Sijo Kg Date: 2009-04-16T19:31:01+09:00 Subject: returning value from ternary operator Hi I have def get_company_details_array c = nil arr = [] if c.nil? c.nil? ? 2.times {arr.push("")} :['a','b'] 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? Thanks in advance Sijo -- Posted via http://www.ruby-forum.com/.