From e37603b5a5c683b69924b4ecb3cf4734d9dcc704 Mon Sep 17 00:00:00 2001 From: Archivist Date: Sat, 11 Aug 2018 12:44:54 +0200 Subject: [PATCH] Made the Ring serializable to JSON --- src/crystal-scatter/ring.cr | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/crystal-scatter/ring.cr b/src/crystal-scatter/ring.cr index b24b4c5..5308719 100644 --- a/src/crystal-scatter/ring.cr +++ b/src/crystal-scatter/ring.cr @@ -1,9 +1,13 @@ +require "json" + module Crystal::Scatter class Slice - property s_begin : UInt64 - property s_end : UInt64 - property url : String + JSON.mapping( + s_begin: UInt64, + s_end: UInt64, + url: String + ) def initialize(@s_begin,@s_end,@url) end