Class: Util::Response
- Inherits:
-
Object
- Object
- Util::Response
- Defined in:
- lib/bs2_api/util/response.rb
Class Method Summary collapse
Class Method Details
.parse_error(res) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/bs2_api/util/response.rb', line 4 def parse_error res hash = JSON.parse(res.body) = "#{res.code}: " if hash.is_a?(Array) << hash[0]["descricao"] elsif hash.key?("error_description") << hash["error_description"] else << hash.to_s end end |