gun_broker 1.2.0 → 1.2.1
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 +4 -4
- data/lib/gun_broker/user/items_delegate.rb +8 -10
- data/lib/gun_broker/user.rb +1 -1
- 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: 594d61c845151e8b420555245091fd08320d2da9
|
4
|
+
data.tar.gz: 533ff44282f602ed59255bb4fd3a0262d6c562b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcf4143c53ede55533dadfe48ade5c7bb4ffda5d205269878f9ed9145deab9e8d4a7a0b41eadc8909a746e93c64e929913377a2f76b1dec82391c0546fb4a854
|
7
|
+
data.tar.gz: f593f7546e4732dbd5c345c40e9e27ce8b3b6c29307bb5b017ae265fc0bfa6a3cf06cdc45cab9f4a4359e15f1e0259d62422442f600988c8146647ddad8377a2
|
@@ -22,7 +22,7 @@ module GunBroker
|
|
22
22
|
endpoint = :Items
|
23
23
|
params = { 'SellerName' => @user.username }
|
24
24
|
|
25
|
-
fetch_items(endpoint, params)
|
25
|
+
@all ||= fetch_items(endpoint, params)
|
26
26
|
end
|
27
27
|
|
28
28
|
# Returns all the items the User has bid on.
|
@@ -32,7 +32,7 @@ module GunBroker
|
|
32
32
|
def bid_on
|
33
33
|
endpoint = :ItemsBidOn
|
34
34
|
|
35
|
-
fetch_items(endpoint)
|
35
|
+
@bid_on ||= fetch_items(endpoint)
|
36
36
|
end
|
37
37
|
|
38
38
|
# Sends a multipart/form-data POST request to create an Item with the given `attributes`.
|
@@ -58,9 +58,7 @@ module GunBroker
|
|
58
58
|
# @return [Item] Returns the Item or `nil` if no Item found.
|
59
59
|
def find(item_id)
|
60
60
|
# HACK: This has to filter through `#all`, since the GunBroker API currently has no way to scope the `/Items/{itemID}` endpoint by user.
|
61
|
-
|
62
|
-
|
63
|
-
if @all.select { |item| item.id.to_s == item_id.to_s }.first
|
61
|
+
if all.select { |item| item.id.to_s == item_id.to_s }.first
|
64
62
|
GunBroker::Item.find(item_id)
|
65
63
|
else
|
66
64
|
nil
|
@@ -84,7 +82,7 @@ module GunBroker
|
|
84
82
|
def not_won
|
85
83
|
endpoint = :ItemsNotWon
|
86
84
|
|
87
|
-
fetch_items(endpoint)
|
85
|
+
@not_won ||= fetch_items(endpoint)
|
88
86
|
end
|
89
87
|
|
90
88
|
# Returns Items that are currently selling.
|
@@ -100,7 +98,7 @@ module GunBroker
|
|
100
98
|
'SellerName' => @user.username,
|
101
99
|
}.delete_if { |k, v| v.nil? }
|
102
100
|
|
103
|
-
fetch_items(endpoint, params)
|
101
|
+
@selling ||= fetch_items(endpoint, params)
|
104
102
|
end
|
105
103
|
|
106
104
|
# Items the User has sold.
|
@@ -114,7 +112,7 @@ module GunBroker
|
|
114
112
|
'ItemID' => (options[:item_id] || options["ItemID"])
|
115
113
|
}.delete_if { |k, v| v.nil? }
|
116
114
|
|
117
|
-
fetch_items(endpoint, params)
|
115
|
+
@sold ||= fetch_items(endpoint, params)
|
118
116
|
end
|
119
117
|
|
120
118
|
# Items that were listed, but not sold.
|
@@ -127,7 +125,7 @@ module GunBroker
|
|
127
125
|
'ItemID' => (options[:item_id] || options["ItemID"])
|
128
126
|
}.delete_if { |k, v| v.nil? }
|
129
127
|
|
130
|
-
fetch_items(endpoint, params)
|
128
|
+
@unsold ||= fetch_items(endpoint, params)
|
131
129
|
end
|
132
130
|
|
133
131
|
# Updates an {Item} with the given attributes.
|
@@ -157,7 +155,7 @@ module GunBroker
|
|
157
155
|
def won
|
158
156
|
endpoint = :ItemsWon
|
159
157
|
|
160
|
-
fetch_items(endpoint)
|
158
|
+
@won ||= fetch_items(endpoint)
|
161
159
|
end
|
162
160
|
|
163
161
|
private
|
data/lib/gun_broker/user.rb
CHANGED
data/lib/gun_broker/version.rb
CHANGED