class SearsApi::Client

Public Class Methods

current_promotions(opt = {}) click to toggle source
# File lib/sears-api.rb, line 43
def current_promotions(opt = {})
  def_opts = {:storeName => 'Sears'}
  def_opts[:storeName] = opt[:store] if opt[:store]
  kget('/CurrentPromotions', :query => def_opts.merge(opt))
end
kget(path,opt = {}) click to toggle source
# File lib/sears-api.rb, line 22
def kget(path,opt = {})
  opt[:query] ||= {}
  opt[:query].merge!({:apikey => SearsApi::Configuration.key, 
                      :store  => 'Sears'}) {|k,v1,v2| v1}
  Response.new(get(path, opt))
end
product_details(part_number, opt = {}) click to toggle source
# File lib/sears-api.rb, line 33
def product_details(part_number, opt = {})
  kget('/productdetails', :query => {:partNumber => part_number}.merge(opt))
end
product_search_by_keyword(keyword, opt = {}) click to toggle source
# File lib/sears-api.rb, line 37
def product_search_by_keyword(keyword, opt = {})
  kget('/productsearch', 
       :query => {:keyword => keyword,:searchType => 'keyword'}.
       merge(opt))
end
store_locator(zip, opt = {}) click to toggle source
# File lib/sears-api.rb, line 29
def store_locator(zip, opt = {})
  kget('/StoreLocator', :query => {:zipCode => '94132'}.merge(opt))
end