Method: Gitlab::Request.decode
- Defined in:
- lib/gitlab/request.rb
.decode(response) ⇒ Object
Decodes a JSON response into Ruby object.
35 36 37 38 39 |
# File 'lib/gitlab/request.rb', line 35 def self.decode(response) response ? JSON.load(response) : {} rescue JSON::ParserError raise Error::Parsing, 'The response is not a valid JSON' end |