Add lookup/2 to the specific types
They proxy to geef_object:lookup/3 which looks up the object and asserts the type.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
-endif.
|
||||
|
||||
-export([bypath/2, id/1]).
|
||||
-export([bypath/2, id/1, lookup/2]).
|
||||
|
||||
-include("geef_records.hrl").
|
||||
|
||||
@@ -19,6 +19,10 @@ bypath(#object{type=tree,handle=Handle}, Path) ->
|
||||
id(Obj = #object{type=tree}) ->
|
||||
geef_object:id(Obj).
|
||||
|
||||
-spec lookup(repo(), oid() | iolist()) -> {ok, object()} | {error, term()}.
|
||||
lookup(Repo, Id) ->
|
||||
geef_object:lookup(Repo, Id, tree).
|
||||
|
||||
-ifdef(TEST).
|
||||
|
||||
%% This is somewhat hacky, assuming that this is running under .eunit,
|
||||
|
||||
Reference in New Issue
Block a user