gun_broker 1.4.6 → 1.4.7

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
  SHA1:
3
- metadata.gz: b9990f619cea255084ff3c897efaf027fa5d4575
4
- data.tar.gz: a902b6b9d8f866c4cfc1d7fa9f85d8fd0afac29e
3
+ metadata.gz: a1dcaa1cda66e9a9dda291ab6776242819df432f
4
+ data.tar.gz: 8f6950fafb6948953c6039a6401365f60b9f364b
5
5
  SHA512:
6
- metadata.gz: e981022683b9263b23a8da740fedd50079d3f40026b865efd5f9ad6ece04379f40c030bb795c0ff1987e26f84267a470d82c2f06bfe380766bda8f9ccdac50a0
7
- data.tar.gz: 97a4210431f36a1d6c5b91cd8727f9530a9b1a3c68702d1005c2a32c0e7f1dcd66d1e8d088793df3034a8c29d344db2d8038250a226f11ab17fcb60fdff7d69a
6
+ metadata.gz: 9753c8115f5ec0abd2642850d0a7875887455594156769615167596678b194ee3dd5a7772e26f8fdb332d63ff6b6f6eb58b5634bfe77478faa24d324a8d0ab0d
7
+ data.tar.gz: 205bea07eec3ec3da1e5a97d77055e6362a7694e1938cb729fb81c6f691a95d8b166014a56ba6ef7ec20eb9905f7c8475f5b7d4b592d7b75afb2829b928ae59e
@@ -37,36 +37,36 @@ module GunBroker
37
37
  # Returns pages for items the User has bid on, but not won.
38
38
  # @note {API#get! GET} /ItemsNotWon
39
39
  # @return [Array<ItemsAsPage>]
40
- def not_won
41
- @not_won ||= build_pages_for(:ItemsNotWon, params_for(:timeframe))
40
+ def not_won(options = {})
41
+ @not_won ||= build_pages_for(:ItemsNotWon, params_for(:timeframe, options))
42
42
  end
43
43
 
44
44
  # Returns pages for items that are currently selling.
45
45
  # @note {API#get! GET} /Items
46
46
  # @return [Array<ItemsAsPage>]
47
47
  def selling
48
- @selling ||= build_pages_for(:Items, params_for(:sellername))
48
+ @selling ||= build_pages_for(:ItemsSelling)
49
49
  end
50
50
 
51
51
  # Returns pages for items the User has sold.
52
52
  # @note {API#get! GET} /ItemsSold
53
53
  # @return [Array<ItemsAsPage>]
54
- def sold
55
- @sold ||= build_pages_for(:ItemsSold, params_for(:timeframe))
54
+ def sold(options = {})
55
+ @sold ||= build_pages_for(:ItemsSold, params_for(:timeframe, options))
56
56
  end
57
57
 
58
58
  # Returns pages for items that were listed, but not sold.
59
59
  # @note {API#get! GET} /ItemsUnsold
60
60
  # @return [Array<ItemsAsPage>]
61
- def unsold
62
- @unsold ||= build_pages_for(:ItemsUnsold, params_for(:timeframe))
61
+ def unsold(options = {})
62
+ @unsold ||= build_pages_for(:ItemsUnsold, params_for(:timeframe, options))
63
63
  end
64
64
 
65
65
  # Returns pages for items the User has won.
66
66
  # @note {API#get! GET} /ItemsWon
67
67
  # @return [Array<ItemsAsPage>]
68
- def won
69
- @won ||= build_pages_for(:ItemsWon, params_for(:timeframe))
68
+ def won(options = {})
69
+ @won ||= build_pages_for(:ItemsWon, params_for(:timeframe, options))
70
70
  end
71
71
 
72
72
  private
@@ -94,12 +94,12 @@ module GunBroker
94
94
  items_as_pages
95
95
  end
96
96
 
97
- def params_for(key)
97
+ def params_for(key, options = {})
98
98
  case key
99
99
  when :sellername
100
100
  { 'SellerName' => @user.username }
101
101
  when :timeframe
102
- { 'TimeFrame' => GunBroker::API::MAX_ITEMS_TIME_FRAME }
102
+ { 'TimeFrame' => (options[:timeframe] || GunBroker::API::MAX_ITEMS_TIME_FRAME) }
103
103
  else
104
104
  raise GunBroker::Error.new 'Unrecognized `params_for` key.'
105
105
  end
@@ -1,3 +1,3 @@
1
1
  module GunBroker
2
- VERSION = "1.4.6"
2
+ VERSION = "1.4.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gun_broker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.6
4
+ version: 1.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Campbell