-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsimple_struct.ex
More file actions
27 lines (22 loc) · 793 Bytes
/
simple_struct.ex
File metadata and controls
27 lines (22 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
defmodule Namespaced.TacoType do
use Thrash.Enumerated
end
defmodule Namespaced.SubStruct do
use Thrash.Protocol.Binary
end
defmodule Namespaced.SimpleStruct do
use Thrash.Protocol.Binary, defaults: [taco_pref: :chicken],
types: [taco_pref: {:enum, TacoType}]
end
defmodule Namespaced do
defmodule AStruct do
use Thrash.Protocol.Binary, source: SubStruct
end
defmodule BStruct do
use Thrash.Protocol.Binary, source: SimpleStruct,
defaults: [taco_pref: :chicken,
sub_struct: %Namespaced.AStruct{}],
types: [taco_pref: {:enum, TacoType},
sub_struct: {:struct, Namespaced.AStruct}]
end
end