Sha256: 9149b91337fa2b40d058b19763cd9051bf12bab09d25f30db2db31198d15aa30
Contents?: true
Size: 397 Bytes
Versions: 105
Compression:
Stored size: 397 Bytes
Contents
# frozen_string_literal: true module Motor class HashSerializer def self.dump(hash) hash.to_json end def self.load(hash) return hash unless hash hash = JSON.parse(hash.presence || '{}') if hash.is_a?(String) if hash.is_a?(Hash) hash.with_indifferent_access else hash.is_a?(FalseClass) ? hash : hash || {} end end end end
Version data entries
105 entries across 105 versions & 7 rubygems