# File lib/dbd/Pg.rb, line 67 def self.generate_array(obj) # XXX yarr, there be recursion here, and it's probably not a good idea. output = "{" obj.each do |item| case item when ::Array output += generate_array(item) else generated = DBI::TypeUtil.convert(driver_name, item) generated = case item when String # in strings, escapes are doubled and the quotes are different. # this gets *really* ugly and needs to be well-tested "\"#{generated.gsub(/\\/) { "\\\\" }}\"" when Fixnum generated.to_s end output += generated end output += "," # FIXME technically, delimiters are variable end output.sub(/,$/, '}') end