Class: Neo4j::Shared::TypeConverters::JSONConverter

Inherits:
BaseConverter
  • Object
show all
Defined in:
lib/neo4j/shared/type_converters.rb

Overview

Converts hash to/from JSON

Class Method Summary collapse

Methods inherited from BaseConverter

#supports_array?

Class Method Details

.convert_typeObject



255
256
257
# File 'lib/neo4j/shared/type_converters.rb', line 255

def convert_type
  JSON
end

.converted?(_value) ⇒ Boolean

Returns:



251
252
253
# File 'lib/neo4j/shared/type_converters.rb', line 251

def converted?(_value)
  false
end

.db_typeObject



259
260
261
# File 'lib/neo4j/shared/type_converters.rb', line 259

def db_type
  String
end

.to_db(value) ⇒ Object



263
264
265
# File 'lib/neo4j/shared/type_converters.rb', line 263

def to_db(value)
  value.to_json
end

.to_ruby(value) ⇒ Object



267
268
269
# File 'lib/neo4j/shared/type_converters.rb', line 267

def to_ruby(value)
  JSON.parse(value, quirks_mode: true)
end