Skip to content

Commit

Permalink
Merge pull request #2 from yubessy/readme
Browse files Browse the repository at this point in the history
add usage
  • Loading branch information
yubessy authored Jan 23, 2019
2 parents c54ea4c + 45a1f76 commit 39a539a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# ToStruct.jl

Easy way to convert dict to struct

## Usage

```
julia> using ToStruct
julia> struct S1
int::Int
str::String
end
julia> struct S2
s1::S1
end
julia> raws2 = Dict("s1" => Dict("int" => 1, "str" => "foo"))
Dict{String,Dict{String,Any}} with 1 entry:
"s1" => Dict{String,Any}("int"=>1,"str"=>"foo")
julia> ToStruct.tostruct(raws2, S2)
S2(S1(1, "foo"))
```

0 comments on commit 39a539a

Please # to comment.