Class: Google::APIClient

Inherits:
Object
  • Object
show all
Defined in:
lib/arvados/google_api_client.rb

Direct Known Subclasses

Arvados::ArvadosClient

Instance Method Summary collapse

Instance Method Details

#discovery_document(api, version) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/arvados/google_api_client.rb', line 10

def discovery_document(api, version)
  api = api.to_s
  discovery_uri = self.discovery_uri(api, version)
  discovery_uri_hash = Digest::MD5.hexdigest(discovery_uri)
  discovery_cache_path =
    File.expand_path("~/.cache/arvados/discovery-#{discovery_uri_hash}.json")
  @discovery_documents[discovery_uri_hash] ||=
    disk_cached_discovery_document(discovery_cache_path) or
    fetched_discovery_document(discovery_uri, discovery_cache_path)
end