infostrada 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a01822268a9c58ef0ef5c1a44515dd82c10909d
4
- data.tar.gz: 2b17d56c7647aa2bb9fef8213ed2134b036ce463
3
+ metadata.gz: 27dc57d05a8dda8028e5277f40f37c3c54abb4a2
4
+ data.tar.gz: f270a70f2c00f227506b467f0944138c0e569041
5
5
  SHA512:
6
- metadata.gz: 58fd3ffee3668102cb76d3bee6f501dd35bc41c9be7ae06cc6b3d9d6d3a4fca5d4ca794a5415199e5e986794505bca106d0f26ab97c78bdc46090590c09ded7a
7
- data.tar.gz: eccf55d6371519a51777b5189f927f5d93055ae76d922971b081cdc41fdb3b2e7260927688a41f947e15e1e971a38ff5219f9fe69cd1168c974ad379b2853fea
6
+ metadata.gz: 2081e65cd8379bd3d0f00acb2c6951c296e51221f9b8ca22e9d390e88b79997138d160931749040c3dcdce07c092b7b1c6f1de340aa9e41fec980fd09cd42ae4
7
+ data.tar.gz: f03d4a93953f6a623d7f0122ca8addce70eeeefac0ab87da45df08bc5b6ffe3ca7e577cf10396f20f25aa7683f65cf0bfa91045c868d1c1048f9a2c5c115515f
@@ -9,22 +9,27 @@ module Infostrada
9
9
 
10
10
  def self.where(options)
11
11
  id = options.delete(:person_id)
12
+
12
13
  info = get!(URL, query: { personid: id }).first
14
+
13
15
  self.new(id, info)
14
16
  end
15
17
 
16
18
  def initialize(id, info)
17
19
  @id = id
18
20
 
19
- @first_name = info['c_FirstName']
20
- @last_name = info['c_LastName']
21
- @public_name = info['c_PublicName']
22
- @nickname = info['c_Nickname']
23
- @birthdate = Formatter.format_date(info['d_BirthDate'])
24
- @height = info['n_Height']
25
- @weight = info['n_Weight']
26
- @birth_city = info['c_BirthCity']
27
- @birth_country = info['c_BirthCountry']
21
+ # Sometimes info comes as an empty array...
22
+ if info && !info.empty?
23
+ @first_name = info['c_FirstName']
24
+ @last_name = info['c_LastName']
25
+ @public_name = info['c_PublicName']
26
+ @nickname = info['c_Nickname']
27
+ @birthdate = Formatter.format_date(info['d_BirthDate'])
28
+ @height = info['n_Height']
29
+ @weight = info['n_Weight']
30
+ @birth_city = info['c_BirthCity']
31
+ @birth_country = info['c_BirthCountry']
32
+ end
28
33
  end
29
34
  end
30
35
  end
@@ -1,3 +1,3 @@
1
1
  module Infostrada
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infostrada
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Otero