geef_object:type/1 helper for elixir

This commit is contained in:
Carlos Martín Nieto
2013-05-30 03:50:45 +02:00
parent 0e644be825
commit 3ec3c454c8

View File

@@ -6,7 +6,7 @@
-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()}.
lookup(Repo, #geef_oid{oid=Oid}) ->
@@ -38,6 +38,10 @@ id(#geef_object{handle=Handle}) ->
Other
end.
-spec type(geef_object()) -> atom().
type(#geef_object{type=Type}) ->
Type.
-ifdef(TEST).
lookup_test() ->