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 +4 -4
- data/lib/gun_broker/user/items_as_pages_delegate.rb +11 -11
- data/lib/gun_broker/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1dcaa1cda66e9a9dda291ab6776242819df432f
|
4
|
+
data.tar.gz: 8f6950fafb6948953c6039a6401365f60b9f364b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(:
|
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
|
data/lib/gun_broker/version.rb
CHANGED