Class: Spandx::Spdx::Gateway

Inherits:
Object
  • Object
show all
Defined in:
lib/spandx/spdx/gateway.rb

Constant Summary collapse

URL =
'https://spdx.org/licenses/licenses.json'

Instance Method Summary collapse

Instance Method Details

#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