Module: Forcast::Utils::Server

Defined in:
lib/forcast/utils/thing.rb,
lib/forcast/utils/server.rb

Defined Under Namespace

Classes: Server, Thing

Class Method Summary collapse

Class Method Details

.response_to_json(response) ⇒ Object



233
234
235
236
237
238
239
240
241
242
243
# File 'lib/forcast/utils/server.rb', line 233

def self.response_to_json (response)

	begin
    	JSON.parse(response.body.readpartial)
       rescue Exception => e
       	return e
       rescue JSON::ParserError => e
       	return e
   	end

end