Sha256: 3e2a0f8c2149348e9ee8a1e175b3e44e5af90af998aa8e1ebdab24762681863d

Contents?: true

Size: 618 Bytes

Versions: 4

Compression:

Stored size: 618 Bytes

Contents

module YouGotListed
  class Client
    
    include HTTParty
    format :xml
    base_uri "https://yougotlistings.com/api"
    
    attr_accessor :api_key
    
    def initialize(api_key)
      self.class.default_params :key => api_key
    end
    
    def perform_request(http_method, path, params = {})
      begin
        self.class.send(http_method, path, :query => params)
      rescue Timeout::Error
        {"YGLResponse" => {"responseCode" => "996", "Error" => "Timeout"}}
      rescue Exception
        {"YGLResponse" => {"responseCode" => "999", "Error" => "Unknown Error"}}
      end
    end
    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
you_got_listed-0.2.3 lib/you_got_listed/client.rb
you_got_listed-0.2.2 lib/you_got_listed/client.rb
you_got_listed-0.2.1 lib/you_got_listed/client.rb
you_got_listed-0.2.0 lib/you_got_listed/client.rb