Class: DB::MariaDB::Native::Types::JSON

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

Overview

A JSON type converter.

Instance Method Summary collapse

Instance Method Details

#nameObject

Get the SQL type name for JSON.



175
176
177
# File 'lib/db/mariadb/native/types.rb', line 175

def name
	"JSON"
end

#parse(string) ⇒ Object

Parse a JSON value from the database.



182
183
184
# File 'lib/db/mariadb/native/types.rb', line 182

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