Browse Source

Made the Ring serializable to JSON

master
Archivist 6 years ago
parent
commit
e37603b5a5
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      src/crystal-scatter/ring.cr

+ 7
- 3
src/crystal-scatter/ring.cr View File

@ -1,9 +1,13 @@
require "json"
module Crystal::Scatter module Crystal::Scatter
class Slice 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) def initialize(@s_begin,@s_end,@url)
end end

Loading…
Cancel
Save