parliament-grom-decorators 0.11.0 → 0.12.0
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/parliament/grom/decorator/person.rb +32 -4
- data/lib/parliament/grom/decorator/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: d73636fa57db22ed08f0fae8f8a1f1e6a0e1cdcb
|
|
4
|
+
data.tar.gz: 5bb160d1e8df59991fab0d00e645da9fc40f76e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 25ba62c53dadb7d21dab1507445f2f95c318d2ddb3b82faad91edc42c6e15a643a30bfdb4e91e951551cbaf28134cf8afcb0d3899211919bc8361ad429eacfc1
|
|
7
|
+
data.tar.gz: 6dc3ca5525ae9d264e9a6563454763fd29a8e568ae369cb86bad02995369f1dea5b55057f6bb66ed69f58aa543f469dc39a8ced0c61e07cb43269246a09126b9
|
|
@@ -162,6 +162,20 @@ module Parliament
|
|
|
162
162
|
@statuses = statuses
|
|
163
163
|
end
|
|
164
164
|
|
|
165
|
+
# Check whether #statuses includes 'Current MP'.
|
|
166
|
+
#
|
|
167
|
+
# @return [Boolean] a boolean depending on whether or not the result of #statuses includes 'Current MP'.
|
|
168
|
+
def current_mp?
|
|
169
|
+
statuses[:house_membership_status].include?('Current MP')
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Check whether #statuses includes 'Member of the House of Lords'.
|
|
173
|
+
#
|
|
174
|
+
# @return [Boolean] a boolean depending on whether or not the result of #statuses includes 'Member of the House of Lords'.
|
|
175
|
+
def current_lord?
|
|
176
|
+
statuses[:house_membership_status].include?('Member of the House of Lords')
|
|
177
|
+
end
|
|
178
|
+
|
|
165
179
|
# Alias D79B0BAC513C4A9A87C9D5AFF1FC632F with fallback.
|
|
166
180
|
#
|
|
167
181
|
# @return [String, String] the full title of the Grom::Node or an empty string.
|
|
@@ -197,11 +211,25 @@ module Parliament
|
|
|
197
211
|
respond_to?(:governmentIncumbency) ? governmentIncumbency : []
|
|
198
212
|
end
|
|
199
213
|
|
|
200
|
-
# Alias
|
|
214
|
+
# Alias personHasPersonalWebLink with fallback.
|
|
215
|
+
#
|
|
216
|
+
# @return [Array|String, nil] all the personal weblinks of the Grom::Node or an nil.
|
|
217
|
+
def personal_weblinks
|
|
218
|
+
respond_to?(:personHasPersonalWebLink) && (current_mp? || current_lord?) ? personHasPersonalWebLink : nil
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Alias personHasTwitterWebLink with fallback.
|
|
222
|
+
#
|
|
223
|
+
# @return [Array|String, nil] all the Twitter weblinks of the Grom::Node or an nil.
|
|
224
|
+
def twitter_weblinks
|
|
225
|
+
respond_to?(:personHasTwitterWebLink) && (current_mp? || current_lord?) ? personHasTwitterWebLink : nil
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Alias personHasFacebookWebLink with fallback.
|
|
201
229
|
#
|
|
202
|
-
# @return [Array|String, nil] all the weblinks of the Grom::Node or an nil.
|
|
203
|
-
def
|
|
204
|
-
respond_to?(:
|
|
230
|
+
# @return [Array|String, nil] all the Facebook weblinks of the Grom::Node or an nil.
|
|
231
|
+
def facebook_weblinks
|
|
232
|
+
respond_to?(:personHasFacebookWebLink) && (current_mp? || current_lord?) ? personHasFacebookWebLink : nil
|
|
205
233
|
end
|
|
206
234
|
|
|
207
235
|
private
|
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.
|
|
4
|
+
version: 0.12.0
|
|
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-10-
|
|
11
|
+
date: 2017-10-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|