Class: Chartmogul::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/chartmogul/response.rb

Class Method Summary collapse

Class Method Details

.parse_json(response) ⇒ Object


5
6
7
8
9
10
11
# File 'lib/chartmogul/response.rb', line 5

def self.parse_json(response)
  JSON.parse(
    response, object_class: Chartmogul.configuration.response_klass
  )
rescue TypeError, JSON::ParserError
  response
end