lib/blinksale/rest_client.rb
# Raises exceptions from Net::HTTP for response codes outside of the 200 range
# or different than the expected response
Raises exceptions from Net::HTTP for response codes outside of the 200 range
or different than the expected response
Raises exceptions from Net :: HTTP for response codes outside of the 200 range or different than the expected response
def handle_response(response, expected = nil)
        response.value
        raise "Expected a #{expected} response" if expected and expected != response.code.to_i
        response
      end
def handle_response ( response , expected = nil ) response . value raise "Expected a #{expected} response" if expected and expected != response . code . to_i response end
Raises exceptions from Net::HTTP for response codes outside of the 200 range
or different than the expected response
Raises exceptions from Net :: HTTP for response codes outside of the 200 range or different than the expected response
# todo: pick a better exception
response
expected