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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a86f9c4a37fe7b3836e74fef82739dabe3e6c24b
4
- data.tar.gz: 6ae5089ea0641f2ead913e8da289c58d8ef43c6c
3
+ metadata.gz: 55c33b7b69af9dedf6c2cd7e81d6f732fd7f75c6
4
+ data.tar.gz: c3e9715859d0a8c6ba0bfeae4c4d1665afca779f
5
5
  SHA512:
6
- metadata.gz: fc569af1eaafe2cea670ab293108f6bdf75f5934be1404932402a6fb2f81406fb86416cc80ca76c8cfafb41fc0e2438c91bd13b09643b14a8214ee9c65a32581
7
- data.tar.gz: 2e16c83787fbc3d37c2ec2f374430db7aa6d73d0237f43ef797df66f2f1e1340a76ac6d2b806018b9cce16462863c6c83f0c4251f3710c37a4abe67247e9b8c3
6
+ metadata.gz: b073d6d5fa3d7c30787cbceab8ffa13b8d6fd1265cabb132653fcc0a5b935d2edfa7a7063a1a3ec5ce2e21013d0a685152e19ca0e37ff66f2acdf963d3e08a0c
7
+ data.tar.gz: d66d884434f2b9caeac8ac98b32b647149a28547389316c93f06c9cfabf77451c8dd78452ae449b0b1814cc26088a6894721093fa86bd857ed8b1279ca10a710
@@ -1,3 +1,3 @@
1
1
  module BoardGameGem
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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
- return BGGItem.new(BoardGameGem.request_xml("thing", options))
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
- return BGGFamily.new(BoardGameGem.request_xml("family", options))
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
- return BGGUser.new(BoardGameGem.request_xml("user", options))
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
- return BGGCollection.new(BoardGameGem.request_xml("collection", options))
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 = {})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: BoardGameGem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Roussel