Skip to content

Commit

Permalink
Add wrek_vert_t:to_list/1
Browse files Browse the repository at this point in the history
  • Loading branch information
rkallos committed Jan 14, 2019
1 parent 1bb4f8b commit 53dd71e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/wrek_vert_t.erl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
has_succeeded/1,
is_finished/1,
succeed/2,
to_list/1,
% getters
args/1,
deps/1,
Expand Down Expand Up @@ -149,6 +150,14 @@ succeed(Vert = #?T{kv = Kv}, Result) ->
set_status(Vert2, done).


-spec to_list(t()) -> [{atom(), any()}].

to_list(T = #?T{}) ->
Fields = record_info(fields, ?T),
[_Tag | Values] = tuple_to_list(T),
lists:zip(Fields, Values).


-spec args(t()) -> args_t().

args(#?T{args = Args}) ->
Expand Down

0 comments on commit 53dd71e

Please sign in to comment.