Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
14
Task/JSON/Crystal/json-2.cr
Normal file
14
Task/JSON/Crystal/json-2.cr
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
require "json"
|
||||
|
||||
class Foo
|
||||
include JSON::Serializable
|
||||
|
||||
property num : Int64
|
||||
property array : Array(String)
|
||||
end
|
||||
|
||||
def json
|
||||
foo = Foo.from_json(%({"num": 1, "array": ["a", "b"]}))
|
||||
puts("#{foo.num} #{foo.array}")
|
||||
puts(foo.to_json)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue