Sha256: 5942f2e522e03e8cea3ba261c91b74602a72283e4cd4296611e6107fcc9cfc23
Contents?: true
Size: 748 Bytes
Versions: 16
Compression:
Stored size: 748 Bytes
Contents
# frozen_string_literal: true class Serega module SeregaJSON # # JSON dump adapter for ::Oj # class OjDump # Default Oj serialization options OPTS = {mode: :compat}.freeze # # Dumps data to JSON string # # @param data [Object] Anything # # @return [String] Data serialized to JSON # def self.call(data) ::Oj.dump(data, OPTS) end end # # JSON parse adapter for ::Oj # class OjLoad # # Loads object from JSON string # # @param json_string [String] JSON String # # @return [Object] Deserialized data # def self.call(json_string) ::Oj.load(json_string) end end end end
Version data entries
16 entries across 16 versions & 1 rubygems