parliament-grom-decorators 0.17.0 → 0.18.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: a37464b31a1038a3b556533191d1c290a8914399
|
4
|
+
data.tar.gz: 4dc6e7f0c32b3bac054a4de54ee9aa383943f63e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 219c237c04e747ffaa0ef2ebad94d011cdbfb7f1d58e4b681dcb72ea55826edbb3f1cad05261268b4a7b5b06da87ae5b0696128dab8e188a9ac803ecb106eca5
|
7
|
+
data.tar.gz: df53ce058ebca4e96954a98c5e10d9374fff1c6e12b9a515dbb86406c04b9d97bdcd42978461c2f507d4dd3de7e6b5501cedee7cb7ee0a4000cb638835515789
|
@@ -5,11 +5,39 @@ module Parliament
|
|
5
5
|
# Collection Grom::Node is a Contentful object associated with a web article (a WebArticle has an Audience node)
|
6
6
|
# Collection Grom::Node is not modelled in the data service, hence type 'http://example..' and not 'https://id.parliament.uk/schema'
|
7
7
|
module Collection
|
8
|
-
# Alias
|
8
|
+
# Alias collectionName with fallback.
|
9
9
|
#
|
10
|
-
# @return [String, String] the
|
11
|
-
def
|
12
|
-
respond_to?(:
|
10
|
+
# @return [String, String] the name of the Grom::Node or an empty string.
|
11
|
+
def name
|
12
|
+
respond_to?(:collectionName) ? collectionName : ''
|
13
|
+
end
|
14
|
+
|
15
|
+
# Alias collectionDescription with fallback.
|
16
|
+
#
|
17
|
+
# @return [String, String] the description of the Grom::Node or an empty string.
|
18
|
+
def description
|
19
|
+
respond_to?(:collectionDescription) ? collectionDescription : ''
|
20
|
+
end
|
21
|
+
|
22
|
+
# Alias collectionHasArticle with fallback.
|
23
|
+
#
|
24
|
+
# @return [Array, Array] an array of Articles related to the Grom::Node or an empty Array.
|
25
|
+
def articles
|
26
|
+
respond_to?(:collectionHasArticle) ? collectionHasArticle : []
|
27
|
+
end
|
28
|
+
|
29
|
+
# Alias collectionHasSubcollection with fallback.
|
30
|
+
#
|
31
|
+
# @return [Array, Array] an array of Subcollections related to the Grom::Node or an empty Array.
|
32
|
+
def subcollections
|
33
|
+
respond_to?(:collectionHasSubcollection) ? collectionHasSubcollection : []
|
34
|
+
end
|
35
|
+
|
36
|
+
# Alias collectionHasParent with fallback.
|
37
|
+
#
|
38
|
+
# @return [Array, Array] an array of Subcollections related to the Grom::Node or an empty Array.
|
39
|
+
def parents
|
40
|
+
respond_to?(:collectionHasParent) ? collectionHasParent : []
|
13
41
|
end
|
14
42
|
end
|
15
43
|
end
|
@@ -24,11 +24,11 @@ module Parliament
|
|
24
24
|
respond_to?(:body) ? body : ''
|
25
25
|
end
|
26
26
|
|
27
|
-
# Alias
|
27
|
+
# Alias articleHasCollection with fallback.
|
28
28
|
#
|
29
29
|
# @return [Array, Array] array of collection Grom::Node or an empty array.
|
30
30
|
def collections
|
31
|
-
respond_to?(:
|
31
|
+
respond_to?(:articleHasCollection) ? articleHasCollection : []
|
32
32
|
end
|
33
33
|
|
34
34
|
# Alias articleType 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.18.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-
|
11
|
+
date: 2018-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|