class Rebay2::Shopping
Constants
- VERSION
Public Class Methods
# File lib/rebay2/shopping.rb, line 6 def base_url_prefix "http://open.api" end
# File lib/rebay2/shopping.rb, line 10 def base_url_suffix "ebay.com/shopping" end
Public Instance Methods
developer.ebay.com/DevZone/shopping/docs/CallRef/FindHalfProducts.html
# File lib/rebay2/shopping.rb, line 27 def find_half_products(params) raise ArgumentError unless params[:ProductID] or params[:QueryKeywords] or (params[:'ProductID.Value'] && params[:'ProductID.type']) response = get_json_response(build_request_url('FindHalfProducts', params)) if response.response.has_key?('Products') && response.response['Products'].has_key?('Product') response.results = response.response['Products']['Product'] end return response end
developer.ebay.com/DevZone/shopping/docs/CallRef/FindPopularItems.html
# File lib/rebay2/shopping.rb, line 95 def find_popular_items(params={}) raise ArgumentError unless params[:CategoryID] or params[:QueryKeywords] response = get_json_response(build_request_url('FindPopularItems', params)) if response.response.has_key?('ItemArray') && response.response['ItemArray'].has_key?('Item') response.results = response.response['ItemArray']['Item'] end return response end
developer.ebay.com/DevZone/shopping/docs/CallRef/FindPopularSearches.html
# File lib/rebay2/shopping.rb, line 85 def find_popular_searches(params) raise ArgumentError unless params[:CategoryID] response = get_json_response(build_request_url('FindPopularSearches', params)) if response.response.has_key?('PopularSearchResult') response.results = response.response['PopularSearchResult'] end return response end
developer.ebay.com/DevZone/shopping/docs/CallRef/FindProducts.html
# File lib/rebay2/shopping.rb, line 16 def find_products(params) raise ArgumentError unless params[:CategoryID] or params[:ProductID] or params[:QueryKeywords] or (params[:'ProductID.Value'] && params[:'ProductID.type']) response = get_json_response(build_request_url('FindProducts', params)) if response.response.has_key?('Product') response.results = response.response['Product'] end return response end
developer.ebay.com/DevZone/shopping/docs/CallRef/FindReviewsandGuides.html
# File lib/rebay2/shopping.rb, line 105 def find_reviews_and_guides(params={}) response = get_json_response(build_request_url('FindReviewsAndGuides', params)) if response.response.has_key?('BuyingGuideDetails') && response.response['BuyingGuideDetails'].has_key?('BuyingGuide') response.results = response.response['BuyingGuideDetails']['BuyingGuide'] end return response end
developer.ebay.com/DevZone/shopping/docs/CallRef/GetCategoryInfo.html
# File lib/rebay2/shopping.rb, line 114 def get_category_info(params) raise ArgumentError unless params[:CategoryID] response = get_json_response(build_request_url('GetCategoryInfo', params)) if response.response.has_key?('CategoryArray') && response.response['CategoryArray'].has_key?('Category') response.results = response.response['CategoryArray']['Category'] end return response end
# File lib/rebay2/shopping.rb, line 123 def get_category_info_with_children(params) params[:IncludeSelector] = 'ChildCategories' response = get_category_info(params) return response end
developer.ebay.com/DevZone/shopping/docs/CallRef/GetItemStatus.html
# File lib/rebay2/shopping.rb, line 48 def get_item_status(params) raise ArgumentError unless params[:ItemID] response = get_json_response(build_request_url('GetItemStatus', params)) if response.response.has_key?('Item') response.results = response.response['Item'] end return response end
developer.ebay.com/DevZone/shopping/docs/CallRef/GetMultipleItems.html
# File lib/rebay2/shopping.rb, line 65 def get_multiple_items(params) raise ArgumentError unless params[:ItemID] response = get_json_response(build_request_url('GetMultipleItems', params)) if response.response.has_key?('Item') response.results = response.response['Item'] end return response end
developer.ebay.com/DevZone/shopping/docs/CallRef/GetShippingCosts.html
# File lib/rebay2/shopping.rb, line 58 def get_shipping_costs(params) raise ArgumentError unless params[:ItemID] response = get_json_response(build_request_url('GetShippingCosts', params)) return response end
developer.ebay.com/DevZone/shopping/docs/CallRef/GetSingleItem.html
# File lib/rebay2/shopping.rb, line 38 def get_single_item(params) raise ArgumentError unless params[:ItemID] response = get_json_response(build_request_url('GetSingleItem', params)) if response.response.has_key?('Item') response.results = response.response['Item'] end return response end
developer.ebay.com/DevZone/shopping/docs/CallRef/GetUserProfile.html
# File lib/rebay2/shopping.rb, line 75 def get_user_profile(params) raise ArgumentError unless params[:UserID] response = get_json_response(build_request_url('GetUserProfile', params)) if response.response.has_key?('User') response.results = response.response['User'] end return response end
Private Instance Methods
# File lib/rebay2/shopping.rb, line 130 def build_request_url(service, params=nil) url = "#{self.class.base_url}?callname=#{service}&appid=#{Rebay2::Api.app_id}&version=#{VERSION}&responseencoding=JSON" url += build_rest_payload({siteid: Rebay2::Api.default_site_id}.merge(params)) return url end