Class: Neo4j::Shared::TypeConverters::YAMLConverter

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

Overview

Converts hash to/from YAML

Class Method Summary collapse

Methods inherited from BaseConverter

converted?, #supports_array?

Class Method Details

.convert_typeObject


230
231
232
# File 'lib/neo4j/shared/type_converters.rb', line 230

def convert_type
  Hash
end

.db_typeObject


234
235
236
# File 'lib/neo4j/shared/type_converters.rb', line 234

def db_type
  String
end

.to_db(value) ⇒ Object


238
239
240
# File 'lib/neo4j/shared/type_converters.rb', line 238

def to_db(value)
  Psych.dump(value)
end

.to_ruby(value) ⇒ Object


242
243
244
# File 'lib/neo4j/shared/type_converters.rb', line 242

def to_ruby(value)
  Psych.load(value)
end