Sha256: 827f65807cf1033838fb13e1f98c52476cf7d34ab60c5bbdeadf75093d6d27f6
Contents?: true
Size: 665 Bytes
Versions: 24
Compression:
Stored size: 665 Bytes
Contents
# frozen_string_literal: true module SidekiqUniqueJobs # Handles loading and dumping of json # # @author Mikael Henriksson <mikael@zoolutions.se> module JSON module_function # # Parses a JSON string into an object # # @param [String] string the object to parse # # @return [Object] # def load_json(string) return unless string && !string.empty? ::JSON.parse(string) end # # Dumps an object into a JSON string # # @param [Object] object a JSON convertible object # # @return [String] a JSON string # def dump_json(object) ::JSON.generate(object) end end end
Version data entries
24 entries across 24 versions & 1 rubygems