geef_object:type/1 helper for elixir
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
-include("geef_records.hrl").
|
-include("geef_records.hrl").
|
||||||
|
|
||||||
-export([lookup/2, lookup/3, id/1]).
|
-export([lookup/2, lookup/3, id/1, type/1]).
|
||||||
|
|
||||||
-spec lookup(pid(), geef_oid() | iolist()) -> {ok, geef_object()} | {error, term()}.
|
-spec lookup(pid(), geef_oid() | iolist()) -> {ok, geef_object()} | {error, term()}.
|
||||||
lookup(Repo, #geef_oid{oid=Oid}) ->
|
lookup(Repo, #geef_oid{oid=Oid}) ->
|
||||||
@@ -38,6 +38,10 @@ id(#geef_object{handle=Handle}) ->
|
|||||||
Other
|
Other
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
-spec type(geef_object()) -> atom().
|
||||||
|
type(#geef_object{type=Type}) ->
|
||||||
|
Type.
|
||||||
|
|
||||||
-ifdef(TEST).
|
-ifdef(TEST).
|
||||||
|
|
||||||
lookup_test() ->
|
lookup_test() ->
|
||||||
|
|||||||
Reference in New Issue
Block a user