module ServiceShooter

Constants

VERSION

Public Class Methods

delete(url, params={}) click to toggle source
# File lib/service_shooter.rb, line 51
def self.delete(url, params={})
  begin
    flat_params = params.collect{|k,v| "#{k}=#{v}"}.join("&")
    response = JSON.parse(RestClient.delete(url+(params.present? ? "?"+flat_params : "")))
  rescue => e
    Rails.logger.fatal e
  end
  response ||= {}
  Response.new(response)
end
get(url, params={}) click to toggle source
# File lib/service_shooter.rb, line 30
def self.get(url, params={})
  begin
    flat_params = params.collect{|k,v| "#{k}=#{v}"}.join("&")
    response = JSON.parse(RestClient.get(url+(params.present? ? "?"+flat_params : "")))
  rescue => e
    Rails.logger.fatal e
  end
  response ||= {}
  Response.new(response)
end
post(url, params={}) click to toggle source
# File lib/service_shooter.rb, line 41
def self.post(url, params={})
  begin
    response = JSON.parse(RestClient.post(url, params))
  rescue => e
    Rails.logger.fatal e
  end
  response ||= {}
  Response.new(response)
end