parliament-grom-decorators 0.26.0 → 0.27.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9420b51cfdc70c699ffbda37e7e4875c11ddc0d8
|
4
|
+
data.tar.gz: 83d3202ecace607648a92282e1d7228c8645061f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a61e8879c6ae40bf635066cb0e0f937cbbc94cb4f88d67d08195853c3f9f8fc73a6f883c5d4815e13d9c2209c2511621add79f3dd693c54686e300a78a5c2ea4
|
7
|
+
data.tar.gz: e38fe70757aad8f58e196443dcb148e4ae0fcb235744807069d5dabcb2d48f143657868433905945bc03683f29f7201358c8d6521d09d4ed1efbd1cb936f8ff1
|
@@ -4,6 +4,27 @@ module Parliament
|
|
4
4
|
# Decorator namespace for Grom::Node instances with type: https://id.parliament.uk/schema/Question.
|
5
5
|
module Question
|
6
6
|
include Helpers::DateHelper
|
7
|
+
# Alias questionHeading with fallback.
|
8
|
+
#
|
9
|
+
# @return [String, String] the question_title of the Grom::Node or an empty string.
|
10
|
+
def question_title
|
11
|
+
respond_to?(:questionHeading) ? questionHeading : ''
|
12
|
+
end
|
13
|
+
|
14
|
+
# Builds a fallback question heading using indexingAndSearchUri.
|
15
|
+
#
|
16
|
+
# @return [String, String] the fallback_heading of the Grom::Node.
|
17
|
+
def fallback_heading
|
18
|
+
"Question #{indexing_search_uri.split('/').last}"
|
19
|
+
end
|
20
|
+
|
21
|
+
# Returns heading or fallback_heading.
|
22
|
+
#
|
23
|
+
# @return [String, String] the heading of the Grom::Node or fallback_heading.
|
24
|
+
def heading
|
25
|
+
question_title.empty? || question_title.include?('Tabled Parliamentary Question') ? fallback_heading : question_title
|
26
|
+
end
|
27
|
+
|
7
28
|
# Alias questionText with fallback.
|
8
29
|
#
|
9
30
|
# @return [String, String] the text of the Grom::Node or an empty string.
|
@@ -11,11 +32,11 @@ module Parliament
|
|
11
32
|
respond_to?(:questionText) ? questionText : ''
|
12
33
|
end
|
13
34
|
|
14
|
-
# Alias
|
35
|
+
# Alias indexingAndSearchUri with fallback.
|
15
36
|
#
|
16
|
-
# @return [String, String] the
|
17
|
-
def
|
18
|
-
respond_to?(:
|
37
|
+
# @return [String, String] the indexing_search_uri of the Grom::Node or an empty string.
|
38
|
+
def indexing_search_uri
|
39
|
+
respond_to?(:indexingAndSearchUri) ? indexingAndSearchUri : ''
|
19
40
|
end
|
20
41
|
|
21
42
|
# Alias questionAskedAt with fallback.
|
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.27.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: 2018-05-
|
11
|
+
date: 2018-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|