parliament-grom-decorators 0.9.0 → 0.10.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.rb +1 -1
- data/lib/parliament/grom/decorator/constituency_group.rb +3 -3
- data/lib/parliament/grom/decorator/contact_point.rb +4 -4
- data/lib/parliament/grom/decorator/government_incumbency.rb +4 -4
- data/lib/parliament/grom/decorator/house_incumbency.rb +8 -8
- data/lib/parliament/grom/decorator/{incumbency.rb → parliamentary_incumbency.rb} +10 -10
- data/lib/parliament/grom/decorator/person.rb +4 -4
- data/lib/parliament/grom/decorator/seat_incumbency.rb +9 -9
- data/lib/parliament/grom/decorator/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7a50745c92ec41261412ed9db2801df65c898378
|
|
4
|
+
data.tar.gz: 7e201cc3e052335a5ba6fd82056fae5d8e158211
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 341874f61f453ccd4a71bcb08d9adbc1761d90db4bc80d8aa0a3e787cbf8adcca114ed98a6cde3ba2204a9862c1b027773a416c0e656cd16f8f5f7cbe560f31c
|
|
7
|
+
data.tar.gz: 8657711f724e4894424641624d334f14355777fd51c213ef095a8144f0fd0c47303b013c6bd9be0b488b73b4b060401b350a4fdbaa6f745f254b228be2dcaffd
|
|
@@ -9,7 +9,7 @@ require 'parliament/grom/decorator/gender_identity'
|
|
|
9
9
|
require 'parliament/grom/decorator/house'
|
|
10
10
|
require 'parliament/grom/decorator/house_incumbency'
|
|
11
11
|
require 'parliament/grom/decorator/house_seat'
|
|
12
|
-
require 'parliament/grom/decorator/
|
|
12
|
+
require 'parliament/grom/decorator/parliamentary_incumbency'
|
|
13
13
|
require 'parliament/grom/decorator/party'
|
|
14
14
|
require 'parliament/grom/decorator/party_membership'
|
|
15
15
|
require 'parliament/grom/decorator/person'
|
|
@@ -50,7 +50,7 @@ module Parliament
|
|
|
50
50
|
@seat_incumbencies = seat_incumbencies.flatten.uniq
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
-
# Alias
|
|
53
|
+
# Alias parliamentaryIncumbencyHasMember with fallback.
|
|
54
54
|
#
|
|
55
55
|
# @return [Array, Array] the members of the Grom::Node or an empty array.
|
|
56
56
|
def members
|
|
@@ -71,7 +71,7 @@ module Parliament
|
|
|
71
71
|
respond_to?(:constituencyGroupHasConstituencyArea) ? constituencyGroupHasConstituencyArea.first : nil
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
-
# Alias
|
|
74
|
+
# Alias parliamentaryIncumbencyHasContactPoint with fallback.
|
|
75
75
|
#
|
|
76
76
|
# @return [Array, Array] the contact points of the Grom::Node or an empty array.
|
|
77
77
|
def contact_points
|
|
@@ -101,7 +101,7 @@ module Parliament
|
|
|
101
101
|
@correct || false
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
-
# Alias
|
|
104
|
+
# Alias parliamentaryIncumbencyHasMember with fallback.
|
|
105
105
|
#
|
|
106
106
|
# @return [Array, Array] the current member of the Grom::Node has a display name.
|
|
107
107
|
def current_member_display_name
|
|
@@ -38,11 +38,11 @@ module Parliament
|
|
|
38
38
|
respond_to?(:contactPointHasPerson) ? contactPointHasPerson : []
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
# Alias
|
|
41
|
+
# Alias contactPointHasParliamentaryIncumbency with fallback.
|
|
42
42
|
#
|
|
43
|
-
# @return [Grom::Node, nil] the incumbency of the Grom::Node or nil.
|
|
44
|
-
def
|
|
45
|
-
respond_to?(:
|
|
43
|
+
# @return [Grom::Node, nil] the parliamentary incumbency of the Grom::Node or nil.
|
|
44
|
+
def parliamentary_incumbency
|
|
45
|
+
respond_to?(:contactPointHasParliamentaryIncumbency) ? contactPointHasParliamentaryIncumbency.first : nil
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
48
|
end
|
|
@@ -6,18 +6,18 @@ module Parliament
|
|
|
6
6
|
module GovernmentIncumbency
|
|
7
7
|
include Helpers::DateHelper
|
|
8
8
|
|
|
9
|
-
# Alias
|
|
9
|
+
# Alias parliamentaryIncumbencyStartDate with fallback.
|
|
10
10
|
#
|
|
11
11
|
# @return [DateTime, nil] the start date of the Grom::Node or nil.
|
|
12
12
|
def start_date
|
|
13
|
-
@start_date ||= respond_to?(:
|
|
13
|
+
@start_date ||= respond_to?(:parliamentaryIncumbencyStartDate) ? DateTime.parse(parliamentaryIncumbencyStartDate) : nil
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
# Alias
|
|
16
|
+
# Alias parliamentaryIncumbencyEndDate with fallback.
|
|
17
17
|
#
|
|
18
18
|
# @return [DateTime, nil] the end date of the Grom::Node or nil.
|
|
19
19
|
def end_date
|
|
20
|
-
@end_date ||= respond_to?(:
|
|
20
|
+
@end_date ||= respond_to?(:parliamentaryIncumbencyEndDate) ? DateTime.parse(parliamentaryIncumbencyEndDate) : nil
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
# Checks if Grom::Node has an end date.
|
|
@@ -5,18 +5,18 @@ module Parliament
|
|
|
5
5
|
module HouseIncumbency
|
|
6
6
|
include Helpers::DateHelper
|
|
7
7
|
|
|
8
|
-
# Alias
|
|
8
|
+
# Alias parliamentaryIncumbencyStartDate with fallback.
|
|
9
9
|
#
|
|
10
10
|
# @return [DateTime, nil] the start date of the Grom::Node or nil.
|
|
11
11
|
def start_date
|
|
12
|
-
@start_date ||= respond_to?(:
|
|
12
|
+
@start_date ||= respond_to?(:parliamentaryIncumbencyStartDate) ? DateTime.parse(parliamentaryIncumbencyStartDate) : nil
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
# Alias
|
|
15
|
+
# Alias parliamentaryIncumbencyEndDate with fallback.
|
|
16
16
|
#
|
|
17
17
|
# @return [DateTime, nil] the end date of the Grom::Node or nil.
|
|
18
18
|
def end_date
|
|
19
|
-
@end_date ||= respond_to?(:
|
|
19
|
+
@end_date ||= respond_to?(:parliamentaryIncumbencyEndDate) ? DateTime.parse(parliamentaryIncumbencyEndDate) : nil
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# Checks if Grom::Node has an end date.
|
|
@@ -33,18 +33,18 @@ module Parliament
|
|
|
33
33
|
respond_to?(:houseIncumbencyHasHouse) ? houseIncumbencyHasHouse.first : nil
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
# Alias
|
|
36
|
+
# Alias parliamentaryIncumbencyHasMember with fallback.
|
|
37
37
|
#
|
|
38
38
|
# @return [Grom::Node, nil] the member connected to the Grom::Node or nil.
|
|
39
39
|
def member
|
|
40
|
-
respond_to?(:
|
|
40
|
+
respond_to?(:parliamentaryIncumbencyHasMember) ? parliamentaryIncumbencyHasMember.first : nil
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
-
# Alias
|
|
43
|
+
# Alias parliamentaryIncumbencyHasContactPoint with fallback.
|
|
44
44
|
#
|
|
45
45
|
# @return [Array, Array] the contact points of the Grom::Node or an empty array.
|
|
46
46
|
def contact_points
|
|
47
|
-
respond_to?(:
|
|
47
|
+
respond_to?(:parliamentaryIncumbencyHasContactPoint) ? parliamentaryIncumbencyHasContactPoint : []
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
50
|
end
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
module Parliament
|
|
2
2
|
module Grom
|
|
3
3
|
module Decorator
|
|
4
|
-
# Decorator namespace for Grom::Node instances with type: http://id.ukpds.org/schema/
|
|
5
|
-
module
|
|
4
|
+
# Decorator namespace for Grom::Node instances with type: http://id.ukpds.org/schema/ParliamentaryIncumbency
|
|
5
|
+
module ParliamentaryIncumbency
|
|
6
6
|
include Helpers::DateHelper
|
|
7
7
|
|
|
8
|
-
# Alias
|
|
8
|
+
# Alias parliamentaryIncumbencyStartDate with fallback.
|
|
9
9
|
#
|
|
10
10
|
# @return [DateTime, nil] the start date of the Grom::Node or nil.
|
|
11
11
|
def start_date
|
|
12
|
-
@start_date ||= respond_to?(:
|
|
12
|
+
@start_date ||= respond_to?(:parliamentaryIncumbencyStartDate) ? DateTime.parse(parliamentaryIncumbencyStartDate) : nil
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
# Alias
|
|
15
|
+
# Alias parliamentaryIncumbencyEndDate with fallback.
|
|
16
16
|
#
|
|
17
17
|
# @return [DateTime, nil] the end date of the Grom::Node or nil.
|
|
18
18
|
def end_date
|
|
19
|
-
@end_date ||= respond_to?(:
|
|
19
|
+
@end_date ||= respond_to?(:parliamentaryIncumbencyEndDate) ? DateTime.parse(parliamentaryIncumbencyEndDate) : nil
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# Checks if Grom::Node has an end date.
|
|
@@ -26,18 +26,18 @@ module Parliament
|
|
|
26
26
|
end_date.nil?
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
# Alias
|
|
29
|
+
# Alias parliamentaryIncumbencyHasMember with fallback.
|
|
30
30
|
#
|
|
31
31
|
# @return [Grom::Node, nil] the member connected to the Grom::Node or nil.
|
|
32
32
|
def member
|
|
33
|
-
respond_to?(:
|
|
33
|
+
respond_to?(:parliamentaryIncumbencyHasMember) ? parliamentaryIncumbencyHasMember.first : nil
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
# Alias
|
|
36
|
+
# Alias parliamentaryIncumbencyHasContactPoint with fallback.
|
|
37
37
|
#
|
|
38
38
|
# @return [Array, Array] the contact points of the Grom::Node or an empty array.
|
|
39
39
|
def contact_points
|
|
40
|
-
respond_to?(:
|
|
40
|
+
respond_to?(:parliamentaryIncumbencyHasContactPoint) ? parliamentaryIncumbencyHasContactPoint : []
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
# Alias seatIncumbencyHasHouseSeat with fallback.
|
|
@@ -58,21 +58,21 @@ module Parliament
|
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
# Alias
|
|
61
|
+
# Alias memberHasParliamentaryIncumbency with fallback.
|
|
62
62
|
#
|
|
63
63
|
# @return [Array, Array] all the incumbencies of the Grom::Node or an empty array.
|
|
64
64
|
def incumbencies
|
|
65
|
-
respond_to?(:
|
|
65
|
+
respond_to?(:memberHasParliamentaryIncumbency) ? memberHasParliamentaryIncumbency : []
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
-
# Alias
|
|
68
|
+
# Alias memberHasParliamentaryIncumbency with fallback.
|
|
69
69
|
#
|
|
70
70
|
# @return [Array, Array] the seat incumbencies of the Grom::Node or an empty array.
|
|
71
71
|
def seat_incumbencies
|
|
72
72
|
@seat_incumbencies ||= incumbencies.select { |inc| inc.type == 'http://id.ukpds.org/schema/SeatIncumbency' }
|
|
73
73
|
end
|
|
74
74
|
|
|
75
|
-
# Alias
|
|
75
|
+
# Alias memberHasParliamentaryIncumbency with fallback.
|
|
76
76
|
#
|
|
77
77
|
# @return [Array, Array] the house incumbencies of the Grom::Node or an empty array.
|
|
78
78
|
def house_incumbencies
|
|
@@ -4,18 +4,18 @@ module Parliament
|
|
|
4
4
|
# Decorator namespace for Grom::Node instances with type: http://id.ukpds.org/schema/SeatIncumbency
|
|
5
5
|
module SeatIncumbency
|
|
6
6
|
include Helpers::DateHelper
|
|
7
|
-
# Alias
|
|
7
|
+
# Alias parliamentaryIncumbencyStartDate with fallback.
|
|
8
8
|
#
|
|
9
9
|
# @return [DateTime, nil] the start date of the Grom::Node or nil.
|
|
10
10
|
def start_date
|
|
11
|
-
respond_to?(:
|
|
11
|
+
respond_to?(:parliamentaryIncumbencyStartDate) ? DateTime.parse(parliamentaryIncumbencyStartDate) : nil
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
# Alias
|
|
14
|
+
# Alias parliamentaryIncumbencyEndDate with fallback.
|
|
15
15
|
#
|
|
16
16
|
# @return [DateTime, nil] the end date of the Grom::Node or nil.
|
|
17
17
|
def end_date
|
|
18
|
-
respond_to?(:
|
|
18
|
+
respond_to?(:parliamentaryIncumbencyEndDate) ? DateTime.parse(parliamentaryIncumbencyEndDate) : nil
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
# Alias seatIncumbencyHasHouseSeat with fallback.
|
|
@@ -36,7 +36,7 @@ module Parliament
|
|
|
36
36
|
#
|
|
37
37
|
# @return [Boolean] a boolean depending on whether or not the Grom::Node has an end date.
|
|
38
38
|
def former?
|
|
39
|
-
respond_to?(:
|
|
39
|
+
respond_to?(:parliamentaryIncumbencyEndDate)
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
# Alias houseSeatHasHouse with fallback.
|
|
@@ -53,18 +53,18 @@ module Parliament
|
|
|
53
53
|
seat.nil? ? nil : seat.constituency
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
-
# Alias
|
|
56
|
+
# Alias parliamentaryIncumbencyHasContactPoint with fallback.
|
|
57
57
|
#
|
|
58
58
|
# @return [Array, Array] the contact points of the Grom::Node or an empty array.
|
|
59
59
|
def contact_points
|
|
60
|
-
respond_to?(:
|
|
60
|
+
respond_to?(:parliamentaryIncumbencyHasContactPoint) ? parliamentaryIncumbencyHasContactPoint : []
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
-
# Alias
|
|
63
|
+
# Alias parliamentaryIncumbencyHasMember with fallback.
|
|
64
64
|
#
|
|
65
65
|
# @return [Grom::Node, nil] the member connected to the Grom::Node or nil.
|
|
66
66
|
def member
|
|
67
|
-
respond_to?(:
|
|
67
|
+
respond_to?(:parliamentaryIncumbencyHasMember) ? parliamentaryIncumbencyHasMember.first : nil
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
70
|
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.
|
|
4
|
+
version: 0.10.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-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -187,8 +187,8 @@ files:
|
|
|
187
187
|
- lib/parliament/grom/decorator/house.rb
|
|
188
188
|
- lib/parliament/grom/decorator/house_incumbency.rb
|
|
189
189
|
- lib/parliament/grom/decorator/house_seat.rb
|
|
190
|
-
- lib/parliament/grom/decorator/incumbency.rb
|
|
191
190
|
- lib/parliament/grom/decorator/member_image.rb
|
|
191
|
+
- lib/parliament/grom/decorator/parliamentary_incumbency.rb
|
|
192
192
|
- lib/parliament/grom/decorator/parliaments.rb
|
|
193
193
|
- lib/parliament/grom/decorator/party.rb
|
|
194
194
|
- lib/parliament/grom/decorator/party_membership.rb
|