Sha256: b252bd6a08b797d35403aa0a744aeb484c8ac91f57ae3c347e492067c2c15e33
Contents?: true
Size: 535 Bytes
Versions: 5
Compression:
Stored size: 535 Bytes
Contents
module Vault module Rails module JSONSerializer DECODE_OPTIONS = { max_nested: false, create_additions: false, }.freeze def self.encode(raw) _init! JSON.fast_generate(raw) end def self.decode(raw) _init! return nil if raw == nil || raw == "" JSON.parse(raw, DECODE_OPTIONS) end protected def self._init! return if defined?(@_init) require "json" @_init = true end end end end
Version data entries
5 entries across 5 versions & 1 rubygems