Sha256: bdfd83367d3c62e75365b108702fc290b38dddf8e3f6ffa0647ce69fc8819488
Contents?: true
Size: 543 Bytes
Versions: 1
Compression:
Stored size: 543 Bytes
Contents
module ArJsonSerialize module Serializer extend self def load(s) if s.present? result = ::MultiJson.load(s) case result when ::Hash ::Hashie::Mash.new(result) when ::Array result.map do |item| if item.is_a?(::Hash) ::Hashie::Mash.new(item) else item end end else result end else '' end end def dump(s) ::MultiJson.dump(s) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ar_json_serialize-0.0.1 | lib/ar_json_serialize/serializer.rb |