Sha256: f4b7cf45cd9d120ebf2985d1de1f92884c7c5471f9ccb3dcfe39072b4b2b15eb
Contents?: true
Size: 707 Bytes
Versions: 8
Compression:
Stored size: 707 Bytes
Contents
module Rentjuicer class Client include HTTParty format :json attr_accessor :api_key def initialize(api_key) self.api_key = api_key self.class.base_uri "api.rentjuice.com/#{self.api_key}" end def process_get(resource, params = {}) begin unless params.blank? self.class.get(resource, :query => params) else self.class.get(resource) end rescue Timeout::Error {"status" => "timeout", "code" => "0", "message" => "Rentjuice API is timing out."} rescue Exception {"status" => "busted", "code" => "0", "message" => "Rentjuice API is erroring."} end end end end
Version data entries
8 entries across 8 versions & 1 rubygems