lib/ebay/requestable.rb in ebay-ruby-0.3.4 vs lib/ebay/requestable.rb in ebay-ruby-0.3.5

- old
+ new

@@ -16,10 +16,22 @@ end # @return [HTTP::Client] attr_writer :http + # @!attribute [r] headers + # @return [Hash] + attr_accessor :headers + + # Sets the eBay Market + # + # @param [String] + def market_id=(market_id) + @headers ||= {} + @headers['X-EBAY-SOA-GLOBAL-ID'] = market_id + end + # @!attribute [r] http # @return [HTTP::Client] def http @http ||= HTTP::Client.new end @@ -57,10 +69,10 @@ # Makes a request through an HTTP proxy # # @param [Array] proxy # @raise [HTTP::Request::Error] if HTTP proxy is invalid # @return [self] - %i[timeout via through headers use].each do |method_name| + %i[timeout via through use].each do |method_name| define_method(method_name) do |*args, &block| self.http = http.send(method_name, *args, &block) self end end