Class: Neo4j::Shared::TypeConverters::JSONConverter
- Inherits:
-
BaseConverter
- Object
- BaseConverter
- Neo4j::Shared::TypeConverters::JSONConverter
- Defined in:
- lib/neo4j/shared/type_converters.rb
Overview
Converts hash to/from JSON
Class Method Summary collapse
- .convert_type ⇒ Object
- .converted?(_value) ⇒ Boolean
- .db_type ⇒ Object
- .to_db(value) ⇒ Object
- .to_ruby(value) ⇒ Object
Methods inherited from BaseConverter
Class Method Details
.convert_type ⇒ Object
255 256 257 |
# File 'lib/neo4j/shared/type_converters.rb', line 255 def convert_type JSON end |
.converted?(_value) ⇒ Boolean
251 252 253 |
# File 'lib/neo4j/shared/type_converters.rb', line 251 def converted?(_value) false end |
.db_type ⇒ Object
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 |