ebay-ruby 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9fbfdf33fe78c10cfdeee697936f0f9eb31a8541a3f0b993d37058539227ac3
4
- data.tar.gz: 1fee63caeec5e67ec429050c970bb4717089d5a6f3c150342e7babb9c735a787
3
+ metadata.gz: 73f278dbdda87fd6d0e8a00df1201f53e5bbde96aef3ee4fb9aecf732d2a20f5
4
+ data.tar.gz: 6b4c462a508393a25d1e4961cfffb022d70982cfe64ca31009f83680f88565f1
5
5
  SHA512:
6
- metadata.gz: cbea01c20e390702353ef7970d08c43fc067efb26a760f89e0884f91b29310795c7bc3bdcd2495e0638d588332a5ed4b927863a2394cac8fe8fa75d287960dcb
7
- data.tar.gz: d759fdf30c035ab2d9934ececd8228d05d2ad9a7eadbfb2128c287af4b5db10b063e4d1b8f8f6198b39a68bda2fb370271ea6bb657ba13722f1a0f5a9bbe74b7
6
+ metadata.gz: 42515946f5c4c0fd3b2d509dcd9feb4b7ebf31ad3662d376c58349603cd6414510e407a5b3a64cb871f1936f6bc74bb16183f250d9ef19d4145b68df3323ca3e
7
+ data.tar.gz: 5456ee468e751528336a9610da8bc2f5f63d4224dd0d70efc980f3a03d474d1e918eca76ba522bfc56c854d7a5e40926277c8e6f1afd8d1469bef9f194b31161
data/lib/ebay/browse.rb CHANGED
@@ -53,7 +53,7 @@ module Ebay
53
53
  #
54
54
  # @param [Hash] params
55
55
  # @return [HTTP::Response]
56
- def search(**params)
56
+ def search(params = {})
57
57
  url = build_url('item_summary', 'search')
58
58
  http.headers(build_headers).get(url, params: params)
59
59
  end
@@ -63,7 +63,7 @@ module Ebay
63
63
  # @param [File] image
64
64
  # @param [Hash] params
65
65
  # @return [HTTP::Response]
66
- def search_by_image(image, **params)
66
+ def search_by_image(image, params = {})
67
67
  url = build_url('item_summary', 'search_by_image')
68
68
  headers = build_headers.update('CONTENT-TYPE' => 'application/json')
69
69
  encoded_string = Base64.encode64(image.read)
@@ -77,9 +77,9 @@ module Ebay
77
77
  # @param [String] item_id
78
78
  # @param [Hash] params
79
79
  # @return [HTTP::Response]
80
- def get_item(item_id, **params)
80
+ def get_item(item_id, params = {})
81
81
  url = build_url('item', item_id)
82
- params.update(item_id: item_id)
82
+ params = params.merge(item_id: item_id)
83
83
 
84
84
  http.headers(build_headers).get(url, params: params)
85
85
  end
@@ -89,9 +89,9 @@ module Ebay
89
89
  # @param [String] legacy_item_id
90
90
  # @param [Hash] params
91
91
  # @return [HTTP::Response]
92
- def get_item_by_legacy_id(legacy_item_id, **params)
92
+ def get_item_by_legacy_id(legacy_item_id, params = {})
93
93
  url = build_url('item', 'get_item_by_legacy_id')
94
- params.update(legacy_item_id: legacy_item_id)
94
+ params = params.merge(legacy_item_id: legacy_item_id)
95
95
 
96
96
  http.headers(build_headers).get(url, params: params)
97
97
  end
data/lib/ebay/finding.rb CHANGED
@@ -77,7 +77,7 @@ module Ebay
77
77
  # @param [Hash] payload
78
78
  # @return [HTTP::Response]
79
79
  def find_items_by_keywords(keywords, payload = {})
80
- payload.update('keywords' => keywords)
80
+ payload = payload.merge('keywords' => keywords)
81
81
  request('findItemsByKeywords', payload)
82
82
  end
83
83
 
@@ -88,8 +88,8 @@ module Ebay
88
88
  # @param [Hash] payload
89
89
  # @return [HTTP::Response]
90
90
  def find_items_by_product(product_id, product_id_type, payload = {})
91
- payload.update('productId' => product_id,
92
- 'productId.@type' => product_id_type)
91
+ payload = payload.merge('productId' => product_id,
92
+ 'productId.@type' => product_id_type)
93
93
 
94
94
  request('findItemsByProduct', payload)
95
95
  end
@@ -133,12 +133,11 @@ module Ebay
133
133
  params = { 'GLOBAL-ID' => global_id,
134
134
  'MESSAGE-ENCODING' => message_encoding,
135
135
  'OPERATION-NAME' => operation,
136
- 'REQUEST-DATA-FORMAT' => 'JSON',
137
136
  'RESPONSE-DATA-FORMAT' => response_data_format,
138
137
  'SECURITY-APPNAME' => security_appname,
139
- 'SERVICE-VERSION' => service_version }.compact
138
+ 'SERVICE-VERSION' => service_version }.update(payload).compact
140
139
 
141
- http.post(endpoint, params: params, body: JSON.dump(payload))
140
+ http.get(endpoint, params: params)
142
141
  end
143
142
  end
144
143
  end
@@ -63,7 +63,7 @@ module Ebay
63
63
  # @param [Hash] payload
64
64
  # @return [HTTP::Response]
65
65
  def get_similar_items(item_id, payload = {})
66
- payload.update('itemId' => item_id)
66
+ payload = payload.merge('itemId' => item_id)
67
67
  request('getSimilarItems', payload)
68
68
  end
69
69
 
data/lib/ebay/shopping.rb CHANGED
@@ -76,7 +76,7 @@ module Ebay
76
76
  # @param [Hash] payload
77
77
  # @return [HTTP::Response]
78
78
  def get_category_info(category_id, payload = {})
79
- payload.update('CategoryID' => category_id)
79
+ payload = payload.merge('CategoryID' => category_id)
80
80
  request('GetCategoryInfo', payload)
81
81
  end
82
82
 
@@ -96,7 +96,7 @@ module Ebay
96
96
  # @return [HTTP::Response]
97
97
  def get_item_status(*item_ids)
98
98
  payload = item_ids.last.is_a?(Hash) ? item_ids.pop : {}
99
- payload.update('ItemID' => item_ids.join(','))
99
+ payload = payload.merge('ItemID' => item_ids.join(','))
100
100
  request('GetItemStatus', payload)
101
101
  end
102
102
 
@@ -108,7 +108,7 @@ module Ebay
108
108
  # @return [HTTP::Response]
109
109
  def get_multiple_items(*item_ids)
110
110
  payload = item_ids.last.is_a?(Hash) ? item_ids.pop : {}
111
- payload.update('ItemID' => item_ids.join(','))
111
+ payload = payload.merge('ItemID' => item_ids.join(','))
112
112
 
113
113
  request('GetMultipleItems', payload)
114
114
  end
@@ -119,7 +119,7 @@ module Ebay
119
119
  # @param [Hash] payload
120
120
  # @return [HTTP::Response]
121
121
  def get_shipping_costs(item_id, payload = {})
122
- payload.update('ItemID' => item_id)
122
+ payload = payload.merge('ItemID' => item_id)
123
123
  request('GetShippingCosts', payload)
124
124
  end
125
125
 
@@ -129,7 +129,7 @@ module Ebay
129
129
  # @param [Hash] payload
130
130
  # @return [HTTP::Response]
131
131
  def get_single_item(item_id, payload = {})
132
- payload.update('ItemID' => item_id)
132
+ payload = payload.merge('ItemID' => item_id)
133
133
  request('GetSingleItem', payload)
134
134
  end
135
135
 
@@ -139,7 +139,7 @@ module Ebay
139
139
  # @param [Hash] payload
140
140
  # @return [HTTP::Response]
141
141
  def get_user_profile(user_id, payload = {})
142
- payload.update('UserID' => user_id)
142
+ payload = payload.merge('UserID' => user_id)
143
143
  request('GetUserProfile', payload)
144
144
  end
145
145
 
data/lib/ebay/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ebay
4
- VERSION = '0.3.1'
4
+ VERSION = '0.3.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ebay-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hakan Ensari