Sha256: 81641b8ef0221b25b914f97275771db56757eb22baf8b8489104e3a1ba60c4a3
Contents?: true
Size: 447 Bytes
Versions: 6
Compression:
Stored size: 447 Bytes
Contents
require 'json' module Beryl module Deserializer extend self def deserialize(item, json = false) item = JSON.parse(item) unless json case item['class'] when 'Hash' item['value'].each_with_object({}) do |(key, value), result| result[key.to_sym] = deserialize(value, true) end when 'Integer' item['value'].to_i when 'String' item['value'] end end end end
Version data entries
6 entries across 6 versions & 1 rubygems