lib/ebay/shopping.rb in ebay-ruby-0.3.3 vs lib/ebay/shopping.rb in ebay-ruby-0.3.4

- old
+ new

@@ -1,11 +1,17 @@ # frozen_string_literal: true require 'ebay/config' require 'ebay/requestable' +# Ruby wrapper to the eBay APIs module Ebay + # Returns a {Ebay::Shopping#initialize Shopping API} instance + def self.shopping(**params) + Shopping.new(**params) + end + # The eBay Shopping API makes it easy to search for things on eBay. # # @see https://developer.ebay.com/Devzone/shopping/docs/Concepts/ShoppingAPI_FormatOverview.html # @see https://developer.ebay.com/Devzone/shopping/docs/CallRef/index.html class Shopping @@ -94,11 +100,11 @@ # @param [String] item_ids # @param [Hash] payload # @return [HTTP::Response] def get_item_status(*item_ids) payload = item_ids.last.is_a?(Hash) ? item_ids.pop : {} - payload = payload.merge('ItemID' => item_ids.join(',')) + payload = payload.merge('ItemID' => item_ids.map(&:to_s)) request('GetItemStatus', payload) end # Retrieves publicly available data for one or more listings # @@ -106,10 +112,10 @@ # @param [String] item_ids # @param [Hash] payload # @return [HTTP::Response] def get_multiple_items(*item_ids) payload = item_ids.last.is_a?(Hash) ? item_ids.pop : {} - payload = payload.merge('ItemID' => item_ids.join(',')) + payload = payload.merge('ItemID' => item_ids.map(&:to_s)) request('GetMultipleItems', payload) end # Gets shipping costs for a listing