Method: Spandx::Spdx::Gateway#fetch

Defined in:
lib/spandx/spdx/gateway.rb

#fetch(url: URL, http: Spandx.http, default: {}) ⇒ Object



8
9
10
11
# File 'lib/spandx/spdx/gateway.rb', line 8

def fetch(url: URL, http: Spandx.http, default: {})
  response = http.get(url, default: default)
  http.ok?(response) ? parse(response.body) : default
end