pipl-api 2.0.0 → 2.0.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/pipl/api/response/person.rb +19 -11
- data/lib/pipl/api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 277759755ec3306fb00f3cf1f318f4dc0ee1f1f5
|
4
|
+
data.tar.gz: 5b3810e03f302b94b929e2a101a55d9e8b844788
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efc50e0f04e19e9cb1d4975180981401c8be43b023c1394f1c73940b4b8e3ed155859718581cde470267e220e063ac9e6d3d53ef555255911a2f01d84a14a7cb
|
7
|
+
data.tar.gz: aa5f4b5f691e1fe1abdcd8c4f5d13844553c35909034b633d2e4431cb9efc49ce4028000e803c7fc951555cb316472adc38f2cba19b558b6104d48fdf5f24e03
|
@@ -25,19 +25,27 @@ module Pipl
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def to_hash
|
28
|
-
|
29
|
-
name:
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
28
|
+
[
|
29
|
+
:name, :full_names, :nicknames,
|
30
|
+
:spellings, :translations, :gender,
|
31
|
+
:locations, :ages, :estimated_world_persons_count
|
32
|
+
].each do |accessor|
|
33
|
+
value = case send(accessor)
|
34
|
+
when Array then send(accessor).map(&:to_hash) if send(accessor).any?
|
35
|
+
when Integer then send(accessor) if send(accessor)
|
36
|
+
else send(accessor).to_hash if send(accessor)
|
37
|
+
end
|
38
|
+
{ accessor => value }
|
39
|
+
end.inject(&:merge!)
|
39
40
|
end
|
40
41
|
alias_method :to_h, :to_hash
|
42
|
+
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def nil_or_hash(subject)
|
47
|
+
subject.to_hash if subject
|
48
|
+
end
|
41
49
|
end
|
42
50
|
end
|
43
51
|
end
|
data/lib/pipl/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pipl-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kurtis Rainbolt-Greene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|