board-game-gem 0.3.0 → 0.3.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.rb +7 -6
- data/lib/boardgamegem/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: a68469b9de477db16f068080c1cdd0c87d96c3c6
|
4
|
+
data.tar.gz: 37e4dbace97f8107463d62ed79b7e91b4c8ddc3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55534770c0e6cc1d1779f1fd02413579330fafb86d65a768d3731457d0eab8b2eeca527d5cf58a0c0a0576272893d86f9d6b3f81606daf4c35eb95d823bc466e
|
7
|
+
data.tar.gz: 16d4b6d9f67331c832b980498d0bd5cf3f6ec9134cd288488eb48f484abfc82e9e2a8760105e07e7ed0deab178af5725ac1cba15bffa19568f92f708f87e433f
|
data/lib/boardgamegem.rb
CHANGED
@@ -5,14 +5,15 @@ module BoardGameGem
|
|
5
5
|
API_ROOT = "https://www.boardgamegeek.com/xmlapi2"
|
6
6
|
MAX_ATTEMPTS = 10
|
7
7
|
|
8
|
-
|
8
|
+
module_function
|
9
|
+
def get_item(id, statistics = false, options = {})
|
9
10
|
options[:id] = id
|
10
11
|
options[:stats] = statistics ? 1 : 0
|
11
12
|
item = BGGItem.new(BoardGameGem.request_xml("thing", options))
|
12
13
|
return item.id == 0 ? nil : item
|
13
14
|
end
|
14
15
|
|
15
|
-
def
|
16
|
+
def get_items(ids, statistics = false, options = {})
|
16
17
|
options[:id] = ids.join(",")
|
17
18
|
options[:stats] = statistics ? 1 : 0
|
18
19
|
item_xml = BoardGameGem.request_xml("thing", options)
|
@@ -24,19 +25,19 @@ module BoardGameGem
|
|
24
25
|
item_list
|
25
26
|
end
|
26
27
|
|
27
|
-
def
|
28
|
+
def get_family(id, options = {})
|
28
29
|
options[:id] = id
|
29
30
|
family = BGGFamily.new(BoardGameGem.request_xml("family", options))
|
30
31
|
return family.id == 0 ? nil : family
|
31
32
|
end
|
32
33
|
|
33
|
-
def
|
34
|
+
def get_user(username, options = {})
|
34
35
|
options[:name] = username
|
35
36
|
user = BGGUser.new(BoardGameGem.request_xml("user", options))
|
36
37
|
return user.id == 0 ? nil : user
|
37
38
|
end
|
38
39
|
|
39
|
-
def
|
40
|
+
def get_collection(username, options = {})
|
40
41
|
options[:username] = username
|
41
42
|
collection_xml = BoardGameGem.request_xml("collection", options)
|
42
43
|
if collection_xml.css("error").length > 0
|
@@ -46,7 +47,7 @@ module BoardGameGem
|
|
46
47
|
end
|
47
48
|
end
|
48
49
|
|
49
|
-
def
|
50
|
+
def search(query, options = {})
|
50
51
|
options[:query] = query
|
51
52
|
xml = BoardGameGem.request_xml("search", options)
|
52
53
|
return {
|
data/lib/boardgamegem/version.rb
CHANGED