gun_broker 1.4.5 → 1.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b3863aa8529ca0b094ac8b6e55dae3662dc8ed7c
4
- data.tar.gz: 5df89b9753c627c7923cce828c66b11f9bc3ccf6
3
+ metadata.gz: b9990f619cea255084ff3c897efaf027fa5d4575
4
+ data.tar.gz: a902b6b9d8f866c4cfc1d7fa9f85d8fd0afac29e
5
5
  SHA512:
6
- metadata.gz: 6166eabf7ad30445180a92dac8661132ee20403f5438fa8a4e43ae134df0a869ea67956bf6d37308291cbe0d9f723b9c9f86248e7ebe692a3059df326538587d
7
- data.tar.gz: 01c86da2dda79b0936e0cdabda65ca0597e332e439cd1737b78b3379bf060a2eb46d812ff4c5d5f4ef716bc723e8e4088c850c0c6fff0f896f505fc48f7011c0
6
+ metadata.gz: e981022683b9263b23a8da740fedd50079d3f40026b865efd5f9ad6ece04379f40c030bb795c0ff1987e26f84267a470d82c2f06bfe380766bda8f9ccdac50a0
7
+ data.tar.gz: 97a4210431f36a1d6c5b91cd8727f9530a9b1a3c68702d1005c2a32c0e7f1dcd66d1e8d088793df3034a8c29d344db2d8038250a226f11ab17fcb60fdff7d69a
@@ -71,8 +71,8 @@ module GunBroker
71
71
  # Items the User has bid on, but not won.
72
72
  # @note {API#get! GET} /ItemsNotWon
73
73
  # @return [Array<Item>]
74
- def not_won
75
- @not_won ||= fetch_items(:ItemsNotWon, params_for(:timeframe))
74
+ def not_won(options = {})
75
+ @not_won ||= fetch_items(:ItemsNotWon, params_for(:timeframe, options))
76
76
  end
77
77
 
78
78
  # Returns Items that are currently selling.
@@ -82,12 +82,7 @@ module GunBroker
82
82
  # @raise [GunBroker::Error::RequestError] If there's an issue with the request (usually a `5xx` response).
83
83
  # @return [Array<Item>]
84
84
  def selling(options = {})
85
- params = [
86
- *params_for(:sellername),
87
- *params_for(:itemid, options)
88
- ].to_h
89
-
90
- @selling ||= fetch_items(:Items, params)
85
+ @selling ||= fetch_items(:ItemsSelling, params_for(:itemid, options))
91
86
  end
92
87
 
93
88
  # Items the User has sold.
@@ -96,7 +91,7 @@ module GunBroker
96
91
  # @return [Array<Item>]
97
92
  def sold(options = {})
98
93
  params = [
99
- *params_for(:timeframe),
94
+ *params_for(:timeframe, options),
100
95
  *params_for(:itemid, options)
101
96
  ].to_h
102
97
 
@@ -109,7 +104,7 @@ module GunBroker
109
104
  # @return [Array<Item>]
110
105
  def unsold(options = {})
111
106
  params = [
112
- *params_for(:timeframe),
107
+ *params_for(:timeframe, options),
113
108
  *params_for(:itemid, options)
114
109
  ].to_h
115
110
 
@@ -139,8 +134,8 @@ module GunBroker
139
134
  # Items the User has won.
140
135
  # @note {API#get! GET} /ItemsWon
141
136
  # @return [Array<Item>]
142
- def won
143
- @won ||= fetch_items(:ItemsWon, params_for(:timeframe))
137
+ def won(options = {})
138
+ @won ||= fetch_items(:ItemsWon, params_for(:timeframe, options))
144
139
  end
145
140
 
146
141
  private
@@ -180,7 +175,7 @@ module GunBroker
180
175
  when :sellername
181
176
  { 'SellerName' => @user.username }
182
177
  when :timeframe
183
- { 'TimeFrame' => GunBroker::API::MAX_ITEMS_TIME_FRAME }
178
+ { 'TimeFrame' => (options[:timeframe] || GunBroker::API::MAX_ITEMS_TIME_FRAME) }
184
179
  when :itemid
185
180
  { 'ItemID' => (options[:item_id] || options["ItemID"]) }
186
181
  else
@@ -1,3 +1,3 @@
1
1
  module GunBroker
2
- VERSION = "1.4.5"
2
+ VERSION = "1.4.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gun_broker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.5
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Campbell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-13 00:00:00.000000000 Z
11
+ date: 2018-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler