Sha256: 7e6b17cccbe9f8b07a0d0bacf747abdee202d77a0c1d1ad49462b3c995c2b045

Contents?: true

Size: 451 Bytes

Versions: 13

Compression:

Stored size: 451 Bytes

Contents

# -*- ruby -*-
# frozen_string_literal: true

require 'json'

module PG
	module TextDecoder
		# This is a decoder class for conversion of PostgreSQL JSON/JSONB type to Ruby Hash, Array, String, Numeric, nil values.
		#
		# As soon as this class is used, it requires the ruby standard library 'json'.
		class JSON < SimpleDecoder
			def decode(string, tuple=nil, field=nil)
				::JSON.parse(string, quirks_mode: true)
			end
		end
	end
end # module PG

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
pg-1.6.0.rc1-x86_64-linux lib/pg/text_decoder/json.rb
pg-1.6.0.rc1-x86-mingw32 lib/pg/text_decoder/json.rb
pg-1.6.0.rc1-x64-mingw32 lib/pg/text_decoder/json.rb
pg-1.6.0.rc1-x64-mingw-ucrt lib/pg/text_decoder/json.rb
pg-1.6.0.rc1 lib/pg/text_decoder/json.rb
pg-1.5.9-x86-mingw32 lib/pg/text_decoder/json.rb
pg-1.5.9-x64-mingw32 lib/pg/text_decoder/json.rb
pg-1.5.9-x64-mingw-ucrt lib/pg/text_decoder/json.rb
pg-1.5.9 lib/pg/text_decoder/json.rb
pg-1.5.8-x64-mingw32 lib/pg/text_decoder/json.rb
pg-1.5.8-x64-mingw-ucrt lib/pg/text_decoder/json.rb
pg-1.5.8-x86-mingw32 lib/pg/text_decoder/json.rb
pg-1.5.8 lib/pg/text_decoder/json.rb