Handle conversions of PostgreSQL array instances
Set the method that will return the correct conversion proc for elements of this array.
# File lib/sequel/adapters/jdbc/postgresql.rb, line 116 def initialize(meth) @conversion_proc_method = meth @conversion_proc = nil end
Convert Java::OrgPostgresqlJdbc4::Jdbc4Array to ruby arrays
# File lib/sequel/adapters/jdbc/postgresql.rb, line 122 def call(v) _pg_array(v.array) end
Handle multi-dimensional Java arrays by recursively mapping them to ruby arrays of ruby values.
# File lib/sequel/adapters/jdbc/postgresql.rb, line 130 def _pg_array(v) v.to_ary.map do |i| if i.respond_to?(:to_ary) _pg_array(i) elsif i if @conversion_proc.nil? @conversion_proc = @conversion_proc_method.call(i) end if @conversion_proc @conversion_proc.call(i) else i end else i end end end