module RDStation::ApiResponse

Public Class Methods

build(response) click to toggle source
# 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