parliament-grom-decorators 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/parliament/grom/decorator/party.rb +23 -0
- data/lib/parliament/grom/decorator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 930448de54e0f6b6a8fe3c3e518e14da407b526f
|
4
|
+
data.tar.gz: 7fb8b49a94a465523517ef3b75a1b0fc6e5b94dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0a85486529095a0951b0b237b5815ae63bee3e77dc9305c6dfdb42e271ed8d0bbbb40a098e7884813d981d9e04420de12ae47f627734b74d60366e70b3cf411
|
7
|
+
data.tar.gz: 65a5c83abd30b48483f4f3888385890b83247870417c3833ea231eaa8e9c78d3c996b0b7956bb2c7953a627e5daf83b8347a8f31a04fe25b00fb21e3873c316a
|
@@ -23,6 +23,29 @@ module Parliament
|
|
23
23
|
def member_count
|
24
24
|
respond_to?(:count) ? count.to_i : nil
|
25
25
|
end
|
26
|
+
|
27
|
+
# Alias commonsCount with fallback.
|
28
|
+
#
|
29
|
+
# @return [Integer, nil] the count of Members of the House of Commons of the Grom::Node or nil.
|
30
|
+
def commons_count
|
31
|
+
respond_to?(:commonsCount) ? commonsCount.to_i : nil
|
32
|
+
end
|
33
|
+
|
34
|
+
# Alias lordsCount with fallback.
|
35
|
+
#
|
36
|
+
# @return [Integer, nil] the count of Members of the House of Lords of the Grom::Node or nil.
|
37
|
+
def lords_count
|
38
|
+
respond_to?(:lordsCount) ? lordsCount.to_i : nil
|
39
|
+
end
|
40
|
+
|
41
|
+
# Checks if Grom::Node has any current members.
|
42
|
+
#
|
43
|
+
# @return [Boolean] a boolean depending on whether or not the Grom::Node has any current members.
|
44
|
+
def current?
|
45
|
+
no_current_total_members = member_count.nil? || member_count.zero?
|
46
|
+
no_current_separate_members = (commons_count.nil? || commons_count.zero?) && (lords_count.nil? || lords_count.zero?)
|
47
|
+
!no_current_total_members || !no_current_separate_members
|
48
|
+
end
|
26
49
|
end
|
27
50
|
end
|
28
51
|
end
|