Module: Docker::Util

Extended by:
Util
Includes:
Error
Included in:
Util
Defined in:
lib/docker/util.rb

Overview

This module holds shared logic that doesn’t really belong anywhere else in the gem.

Instance Method Summary collapse

Instance Method Details

#parse_json(body) ⇒ Object



7
8
9
10
11
# File 'lib/docker/util.rb', line 7

def parse_json(body)
  JSON.parse(body) unless body.nil? || body.empty? || (body == 'null')
rescue JSON::ParserError => ex
  raise UnexpectedResponseError, ex.message
end