Module: RDStation::ApiResponse

Defined in:
lib/rdstation/api_response.rb

Class Method Summary collapse

Class Method Details

.build(response) ⇒ Object



3
4
5
6
7
# File 'lib/rdstation/api_response.rb', line 3

def self.build(response)
  return JSON.parse(response.body) if response.code.between?(200, 299)

  RDStation::ErrorHandler.new(response).raise_error
end