parliament-grom-decorators 0.25.0 → 0.25.1
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: 06de8a0e1256fab3b1a807da878c1620d1ec8b12
|
4
|
+
data.tar.gz: b85c5b82b9a3e28fbc170b74a0d5e4be1da88746
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3d9e64d32e0286557265476675edf8555b4708c19f4cce629b5cc82822c61df5284b68e38d1a4519e5924d339c1ea9a1ae8bd0e208b0b01ce3cfa70ef30bcdb
|
7
|
+
data.tar.gz: 50b3a65514e3c96d45824f3b79e69d0d6c6492db0852023270a6b7ba8c70e2667ee1ec013f7a019ae4f4270cb36db3916c8813a19c6110091125e6df63cafda1
|
@@ -22,7 +22,7 @@ module Parliament
|
|
22
22
|
#
|
23
23
|
# @return [Integer, nil] the count of members of the Grom::Node or nil.
|
24
24
|
def member_count
|
25
|
-
respond_to?(:
|
25
|
+
respond_to?(:memberCount) ? memberCount.to_i : nil
|
26
26
|
end
|
27
27
|
|
28
28
|
# Alias groupEndDate with fallback.
|
@@ -31,6 +31,11 @@ module Parliament
|
|
31
31
|
def end_date
|
32
32
|
@end_date ||= respond_to?(:groupEndDate) ? DateTime.parse(groupEndDate) : nil
|
33
33
|
end
|
34
|
+
|
35
|
+
# @return [Boolean] whether the group is also a formal body.
|
36
|
+
def formal_body?
|
37
|
+
type.include?('https://id.parliament.uk/schema/FormalBody')
|
38
|
+
end
|
34
39
|
end
|
35
40
|
end
|
36
41
|
end
|
@@ -82,7 +82,7 @@ module Parliament
|
|
82
82
|
#
|
83
83
|
# @return [Array, Array] the seat incumbencies of the Grom::Node or an empty array.
|
84
84
|
def seat_incumbencies
|
85
|
-
@seat_incumbencies ||= incumbencies.select { |inc| inc.type
|
85
|
+
@seat_incumbencies ||= incumbencies.select { |inc| inc.type.include?('https://id.parliament.uk/schema/SeatIncumbency') }
|
86
86
|
end
|
87
87
|
|
88
88
|
# @return [Grom::Node] the seat incumbency as a Grom::Node or nil
|
@@ -303,11 +303,11 @@ module Parliament
|
|
303
303
|
private
|
304
304
|
|
305
305
|
def current_member_by_house?(house_name)
|
306
|
-
|
306
|
+
seat_incumbencies.select { |incumbency| incumbency.house.name == house_name && incumbency.end_date.nil? }.any?
|
307
307
|
end
|
308
308
|
|
309
309
|
def former_member_by_house?(house_name)
|
310
|
-
|
310
|
+
seat_incumbencies.select { |incumbency| incumbency.house.name == house_name && incumbency.end_date }.any?
|
311
311
|
end
|
312
312
|
|
313
313
|
def house_membership_status
|
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.25.
|
4
|
+
version: 0.25.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: 2018-04-
|
11
|
+
date: 2018-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|