parliament-grom-decorators 0.12.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/parliament/grom/decorator/person.rb +10 -6
- 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: 51e57a33a212ca35c68f2436d3178c0458315098
|
4
|
+
data.tar.gz: 8836f8d58905bb5c58acca433a8aa65e81593141
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06adc2d5b62082e48690c06a7b0cfca2bd9181bd6b453125c21b894b9059c16425fd9cc706ebcae2e741412a61aaedc99eb484ccdaa300488d4ca145c77dbb41
|
7
|
+
data.tar.gz: 4157e584cf53dc513369d6d26ce24ce6bf1426b66180515052a4fa9c78b8a6b4635139d9cab99aec13f780c96e96dd89fe2ba666a8217645c2e42815a98c70ba
|
@@ -213,23 +213,23 @@ module Parliament
|
|
213
213
|
|
214
214
|
# Alias personHasPersonalWebLink with fallback.
|
215
215
|
#
|
216
|
-
# @return [Array
|
216
|
+
# @return [Array, Array] all the personal weblinks of the Grom::Node or an empty Array.
|
217
217
|
def personal_weblinks
|
218
|
-
|
218
|
+
[*get_weblinks_by_predicate(:personHasPersonalWebLink)]
|
219
219
|
end
|
220
220
|
|
221
221
|
# Alias personHasTwitterWebLink with fallback.
|
222
222
|
#
|
223
|
-
# @return [Array
|
223
|
+
# @return [Array, Array] all the Twitter weblinks of the Grom::Node or an empty array.
|
224
224
|
def twitter_weblinks
|
225
|
-
|
225
|
+
[*get_weblinks_by_predicate(:personHasTwitterWebLink)]
|
226
226
|
end
|
227
227
|
|
228
228
|
# Alias personHasFacebookWebLink with fallback.
|
229
229
|
#
|
230
|
-
# @return [Array
|
230
|
+
# @return [Array, Array] all the Facebook weblinks of the Grom::Node or an empty array.
|
231
231
|
def facebook_weblinks
|
232
|
-
|
232
|
+
[*get_weblinks_by_predicate(:personHasFacebookWebLink)]
|
233
233
|
end
|
234
234
|
|
235
235
|
private
|
@@ -265,6 +265,10 @@ module Parliament
|
|
265
265
|
status[0] = status[0].downcase if index != 0
|
266
266
|
end
|
267
267
|
end
|
268
|
+
|
269
|
+
def get_weblinks_by_predicate(weblink_predicate)
|
270
|
+
(respond_to?(weblink_predicate) && (current_mp? || current_lord?) ? send(weblink_predicate) : nil)
|
271
|
+
end
|
268
272
|
end
|
269
273
|
end
|
270
274
|
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.12.
|
4
|
+
version: 0.12.1
|
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-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|