module Sfn::Utils::JSON
JSON
helper methods
Public Instance Methods
_format_json(thing)
click to toggle source
Format object into pretty JSON
@param thing [Object] @return [String]
# File lib/sfn/utils/json.rb, line 33 def _format_json(thing) thing = _from_json(thing) if thing.is_a?(String) MultiJson.dump(thing, :pretty => true) end
Also aliased as: format_json
_from_json(thing)
click to toggle source
Load JSON
data
@param thing [String] @return [Object]
# File lib/sfn/utils/json.rb, line 23 def _from_json(thing) MultiJson.load(thing) end
Also aliased as: load_json