module PolyNotify::Utilities

Public Instance Methods

get(*args, &block) click to toggle source

HTTParty get wrapper. This serves to clean up code, as well as throw webserver errors wherever needed

# File lib/PolyNotify/utilities.rb, line 5
def get *args, &block
  response = self.class.get *args, &block
  raise WebserverError, response.code unless response.code == 200
  response
end
post(*args, &block) click to toggle source

HTTParty POST wrapper. This serves to clean up code, as well as throw webserver errors wherever needed

# File lib/PolyNotify/utilities.rb, line 13
def post *args, &block
  response = self.class.post *args, &block
  raise WebserverError, response.code unless response.code == 200
  response
end