Sha256: ac4d5f809a46dc0792ffc8fb62b468761e97a32fe7edd096c8a2b45b22b5db0c

Contents?: true

Size: 338 Bytes

Versions: 1

Compression:

Stored size: 338 Bytes

Contents

module Seabright
	module Types
		module JsonType
			
			def format_json(val)
				return val unless val.is_a?(String)
				val ? Yajl::Parser.new(:symbolize_keys => true).parse(val) : nil
			end
			
			def save_json(val)
				return val if val.is_a?(String)
				Yajl::Encoder.encode(val)
			end
			
		end
		
		register_type :Json
		
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
redis_object-1.5.3 lib/redis_object/types/json.rb