Skip to content

Commit a21ccad

Browse files
optimize the top level links call to be done only once
1 parent aea832f commit a21ccad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/ontologies_api_client/collection.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ def method_missing(meth, *args, &block)
2929
##
3030
# Get all top-level links for the API
3131
def top_level_links(link = LinkedData::Client.settings.rest_url)
32-
HTTP.get(link)
32+
@top_level_links ||= {}
33+
@top_level_links[link] ||= HTTP.get(link)
3334
end
3435

3536
##

0 commit comments

Comments
 (0)