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: c5a3384204f9c1c73a66be5d233ce66db88b9712
4
- data.tar.gz: '0018ada8f8a452e0833d3192cb4e10942e7586c7'
3
+ metadata.gz: a37464b31a1038a3b556533191d1c290a8914399
4
+ data.tar.gz: 4dc6e7f0c32b3bac054a4de54ee9aa383943f63e
5
5
  SHA512:
6
- metadata.gz: eda2aeee9b09e461eb4dd218bf35b18b6ec055838eaa59481f554393b77ba97c4ea7f948c5e4b08f673ab7cec7c63538e106c21ae3cc885d948f89bf002c17ef
7
- data.tar.gz: d0dfdad5d9e670d4123de29a0060711e438dc53cd313b074a516977336158bc4beea25836a0091d514e89a1157e1c8520bbbabdf06d44156c3ae24d43c01461f
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 name with fallback.
8
+ # Alias collectionName with fallback.
9
9
  #
10
- # @return [String, String] the title of the Grom::Node or an empty string.
11
- def collection_name
12
- respond_to?(:name) ? name : ''
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
@@ -1,7 +1,7 @@
1
1
  module Parliament
2
2
  module Grom
3
3
  module Decorator
4
- VERSION = '0.17.0'.freeze
4
+ VERSION = '0.18.0'.freeze
5
5
  end
6
6
  end
7
7
  end
@@ -24,11 +24,11 @@ module Parliament
24
24
  respond_to?(:body) ? body : ''
25
25
  end
26
26
 
27
- # Alias collection with fallback.
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?(:collection) ? collection : []
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.17.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-02-27 00:00:00.000000000 Z
11
+ date: 2018-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler