BoardGameGem 0.1.0 → 0.1.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/boardgamegem/version.rb +1 -1
- data/lib/boardgamegem.rb +12 -4
- 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: 55c33b7b69af9dedf6c2cd7e81d6f732fd7f75c6
|
4
|
+
data.tar.gz: c3e9715859d0a8c6ba0bfeae4c4d1665afca779f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b073d6d5fa3d7c30787cbceab8ffa13b8d6fd1265cabb132653fcc0a5b935d2edfa7a7063a1a3ec5ce2e21013d0a685152e19ca0e37ff66f2acdf963d3e08a0c
|
7
|
+
data.tar.gz: d66d884434f2b9caeac8ac98b32b647149a28547389316c93f06c9cfabf77451c8dd78452ae449b0b1814cc26088a6894721093fa86bd857ed8b1279ca10a710
|
data/lib/boardgamegem/version.rb
CHANGED
data/lib/boardgamegem.rb
CHANGED
@@ -8,22 +8,30 @@ module BoardGameGem
|
|
8
8
|
def BoardGameGem.get_item(id, statistics = false, options = {})
|
9
9
|
options[:id] = id
|
10
10
|
options[:stats] = statistics ? 1 : 0
|
11
|
-
|
11
|
+
item = BGGItem.new(BoardGameGem.request_xml("thing", options))
|
12
|
+
return item.id == 0 ? nil : item
|
12
13
|
end
|
13
14
|
|
14
15
|
def BoardGameGem.get_family(id, options = {})
|
15
16
|
options[:id] = id
|
16
|
-
|
17
|
+
family = BGGFamily.new(BoardGameGem.request_xml("family", options))
|
18
|
+
return family.id == 0 ? nil : family
|
17
19
|
end
|
18
20
|
|
19
21
|
def BoardGameGem.get_user(username, options = {})
|
20
22
|
options[:name] = username
|
21
|
-
|
23
|
+
user = BGGUser.new(BoardGameGem.request_xml("user", options))
|
24
|
+
return user.id == 0 ? nil : user
|
22
25
|
end
|
23
26
|
|
24
27
|
def BoardGameGem.get_collection(username, options = {})
|
25
28
|
options[:username] = username
|
26
|
-
|
29
|
+
collection_xml = BoardGameGem.request_xml("collection", options)
|
30
|
+
if collection_xml.css("error").length > 0
|
31
|
+
return nil
|
32
|
+
else
|
33
|
+
return BGGCollection.new(collection_xml)
|
34
|
+
end
|
27
35
|
end
|
28
36
|
|
29
37
|
def BoardGameGem.search(query, options = {})
|