Class: DB::Postgres::Native::Types::JSON

Inherits:
Object
  • Object
show all
Defined in:
lib/db/postgres/native/types.rb

Overview

A JSON type converter.

Instance Method Summary collapse

Instance Method Details

#nameObject

Get the SQL type name for JSON.



176
177
178
# File 'lib/db/postgres/native/types.rb', line 176

def name
	"JSON"
end

#parse(string) ⇒ Object

Parse a JSON value from the database.



183
184
185
# File 'lib/db/postgres/native/types.rb', line 183

def parse(string)
	::JSON.parse(string, symbolize_names: true) if string
end