Sha256: a0454fc01103698464e7f1b251c40cc4497fff942af917641a554a14cf4cbb94

Contents?: true

Size: 622 Bytes

Versions: 6

Compression:

Stored size: 622 Bytes

Contents

module YouGotListed
  class Client
    
    include HTTParty
    format :xml
    base_uri "https://www.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

6 entries across 6 versions & 1 rubygems

Version Path
you_got_listed-0.3.3 lib/you_got_listed/client.rb
you_got_listed-0.3.2 lib/you_got_listed/client.rb
you_got_listed-0.3.1 lib/you_got_listed/client.rb
you_got_listed-0.3.0 lib/you_got_listed/client.rb
you_got_listed-0.2.5 lib/you_got_listed/client.rb
you_got_listed-0.2.4 lib/you_got_listed/client.rb