Sha256: 38484492082fe288cceb3d54cb12b87fc6714be030d5d9c181dcf7b023fb8442
Contents?: true
Size: 791 Bytes
Versions: 15
Compression:
Stored size: 791 Bytes
Contents
require 'sfn' module Sfn module Utils # JSON helper methods module JSON # Convert to JSON # # @param thing [Object] # @return [String] def _to_json(thing) MultiJson.dump(thing) end alias_method :dump_json, :_to_json # Load JSON data # # @param thing [String] # @return [Object] def _from_json(thing) MultiJson.load(thing) end alias_method :load_json, :_from_json # Format object into pretty JSON # # @param thing [Object] # @return [String] def _format_json(thing) thing = _from_json(thing) if thing.is_a?(String) MultiJson.dump(thing, :pretty => true) end alias_method :format_json, :_format_json end end end
Version data entries
15 entries across 15 versions & 1 rubygems