gun_broker 0.4.9 → 0.4.10
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/item.rb +5 -0
- data/lib/gun_broker/version.rb +1 -1
- data/spec/gun_broker/item_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c687115710d2b3b4ae4077e5ff299b1075f30497
|
4
|
+
data.tar.gz: 6e23ed43316ff7fa3def0dfd86e201ed848ccf86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77af880adb23a7faf6834691dcc0268b3f00b4dc3d8d9a69499d04ff43a7b45a27c26489562350bfefa0ae222c62c40db642636d83fe1280f9d36206c833af1b
|
7
|
+
data.tar.gz: c95de60b57c154dd59d26a9ed4cbd6732d637df86d460897c1f977f4a3013eb96c6feb502118a6cbd61a8e74c6de46def89cd8ee1394e08e52d8c41ca0fecc2c
|
data/lib/gun_broker/item.rb
CHANGED
@@ -52,6 +52,11 @@ module GunBroker
|
|
52
52
|
@attrs['title']
|
53
53
|
end
|
54
54
|
|
55
|
+
# @return [String] GunBroker.com URL for this Item.
|
56
|
+
def url
|
57
|
+
"http://www.gunbroker.com/Auction/ViewItem.aspx?Item=#{id}"
|
58
|
+
end
|
59
|
+
|
55
60
|
# @param key [String] An Item attribute name (from the JSON response).
|
56
61
|
# @return The value of the given `key` or `nil`.
|
57
62
|
def [](key)
|
data/lib/gun_broker/version.rb
CHANGED
@@ -94,4 +94,14 @@ describe GunBroker::Item do
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
+
context '#url' do
|
98
|
+
it 'returns a fully qualified URL' do
|
99
|
+
id = '123'
|
100
|
+
item = GunBroker::Item.new({ 'itemID' => id })
|
101
|
+
url = "http://www.gunbroker.com/Auction/ViewItem.aspx?Item=#{id}"
|
102
|
+
|
103
|
+
expect(item.url).to eq(url)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
97
107
|
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: 0.4.
|
4
|
+
version: 0.4.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Campbell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|