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