parliament-grom-decorators 0.2.4.pre → 0.2.5.pre
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 03a39b039c0a37b0d9036e195585df5179fd41c9
|
|
4
|
+
data.tar.gz: abe7d7f49358a540d34d3b316b157cd77ab51961
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 482ba6e4c812479d10d4b791c22bf552347f71ef42f276d4220796ed7f02459ab30db7103764155d96ffc1c950e5ad33f9ebaf5e6d18c12739e65050671ee87c
|
|
7
|
+
data.tar.gz: 3ad82469cd0c93236084cb68ec602d97b53c43816fed73b8684a82ca7ca1d5fde9c2aaac33fd5294b26598934ad51debdfa0d17337367ecdf8d4f1b34d706fb0
|
|
@@ -15,6 +15,7 @@ require 'parliament/grom/decorator/person'
|
|
|
15
15
|
require 'parliament/grom/decorator/postal_address'
|
|
16
16
|
require 'parliament/grom/decorator/seat_incumbency'
|
|
17
17
|
require 'parliament/grom/decorator/parliaments'
|
|
18
|
+
require 'parliament/grom/decorator/member_image'
|
|
18
19
|
|
|
19
20
|
# Namespace for classes and modules that handle connections to, and processing of data from the parliamentary API.
|
|
20
21
|
# @since 0.1.0
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Parliament
|
|
2
|
+
module Grom
|
|
3
|
+
module Decorator
|
|
4
|
+
# Decorator namespace for Grom::Node instances with type: http://id.ukpds.org/schema/MemberImage
|
|
5
|
+
module MemberImage
|
|
6
|
+
# Alias memberImageHasMember with fallback.
|
|
7
|
+
#
|
|
8
|
+
# @return [Grom::Node, nil] the person connected to the Grom::Node or nil.
|
|
9
|
+
def person
|
|
10
|
+
respond_to?(:memberImageHasMember) ? memberImageHasMember.first : nil
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -47,12 +47,12 @@ module Parliament
|
|
|
47
47
|
@full_name = full_name.join(' ')
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
# Alias
|
|
50
|
+
# Alias personHasPersonImage with fallback.
|
|
51
51
|
#
|
|
52
52
|
# @return [String, String] the image location of the Grom::Node or a placeholder string.
|
|
53
|
-
def image_id(show_placeholder:true)
|
|
54
|
-
if respond_to?(:
|
|
55
|
-
|
|
53
|
+
def image_id(show_placeholder: true)
|
|
54
|
+
if respond_to?(:memberHasMemberImage)
|
|
55
|
+
memberHasMemberImage.first.graph_id
|
|
56
56
|
else
|
|
57
57
|
show_placeholder ? 'placeholder' : nil
|
|
58
58
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: parliament-grom-decorators
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.5.pre
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rebecca Appleyard
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-07-
|
|
11
|
+
date: 2017-07-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -182,6 +182,7 @@ files:
|
|
|
182
182
|
- lib/parliament/grom/decorator/house_incumbency.rb
|
|
183
183
|
- lib/parliament/grom/decorator/house_seat.rb
|
|
184
184
|
- lib/parliament/grom/decorator/incumbency.rb
|
|
185
|
+
- lib/parliament/grom/decorator/member_image.rb
|
|
185
186
|
- lib/parliament/grom/decorator/parliaments.rb
|
|
186
187
|
- lib/parliament/grom/decorator/party.rb
|
|
187
188
|
- lib/parliament/grom/decorator/party_membership.rb
|