Sha256: b41ab06ba866c276a9c7780e60232e890a48c5510e72d6ead953dbe7a28a24bb

Contents?: true

Size: 856 Bytes

Versions: 2

Compression:

Stored size: 856 Bytes

Contents

# -*- coding: utf-8 -*-

module Recalls
  class Client
    module Products
    include Recalls::Client::Connection
    
    # Returns a hash of products matching the search.
    #
    # @return {Hash}
    # @param query
    # @param start_date
    # @param end_date
    # @param organization opptions NHSTA, CPSC, CDC
    # @param upc
    # @param sort sort=date 
    # @param page
    # @param year only for NHSTA (Traffic)
    # @param make only for NHSTA (Traffic)
    # @param model only for NHSTA (Traffic)        
    # @see http://search.usa.gov/api/recalls
    # @example Returns results based upon queries
    #   Recalls.search(:query => "bad cheese")
    
      def search(options = {})
        options.merge!({:format => "json"})                
        response = get('', options) rescue "Invalid API Key"  
      end
      
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
recalls-0.1 lib/recalls/client/products.rb
Recalls-0.1 lib/recalls/client/products.rb