11module Profiles
22
3+
4+ using .. Types: CONFIG_DIR
5+ using Base: UUID
6+
37using Pkg. TOML
48import Base. Dict
59
10+
11+
612struct Profile
7- name:: AbstractString
13+ uuid:: UUID
14+ name:: Union{AbstractString,Nothing}
815 date:: Union{AbstractString,Nothing}
916 about:: Union{AbstractString,Nothing}
1017 homepage:: Union{AbstractString,Nothing}
1724function Dict (profile:: Profile )
1825 dict = Dict ()
1926
27+ dict[" uuid" ] = string (profile. uuid)
2028 isnothing (profile. name) || (dict[" name" ] = profile. name)
2129 isnothing (profile. date) || (dict[" date" ] = profile. date)
2230 isnothing (profile. about) || (dict[" about" ] = profile. about)
3139
3240# ## I could use this for the tests with something like Profile(Dict("name"=>"account1"))
3341function Profile (dict:: Dict )
34-
42+ uuid = UUID (dict[ " uuid " ])
3543 haskey (dict," name" ) ? (name= dict[" name" ]) : (name= nothing )
3644 haskey (dict," date" ) ? (date= dict[" date" ]) : (date= nothing )
3745 haskey (dict," about" ) ? (about= dict[" about" ]) : (about= nothing )
@@ -43,7 +51,7 @@ function Profile(dict::Dict)
4351
4452 # One may also add membership of each deme as part of the profile additionally with signatures in a envelope form.
4553
46- return Profile (name,date,about,homepage,email,facebook,twitter,github)
54+ return Profile (uuid, name,date,about,homepage,email,facebook,twitter,github)
4755end
4856
4957function save (fname:: AbstractString ,profile:: Profile )
0 commit comments