parliament-ruby 0.5.7 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/parliament/decorators/person.rb +17 -1
- data/lib/parliament/response.rb +4 -0
- data/lib/parliament/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: 2d14dd3dc4a909bd1a4b34c91cd3f1db63fead1e
|
4
|
+
data.tar.gz: cf3facc1bdb12d813549b80bf52a2d128eddf15c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41bd68ebff5ed14e31b5aa6fe6afd26f00f6cca845241e34efdbabe520d1ecdc39f34f07860fb548a923faa0dc67a55f9cb7b11fd7aa4d0581b296348409576c
|
7
|
+
data.tar.gz: 8579c1e01f0bb33a424e948788cbf25896434dcdc62d5843f77bf13ab1f34c7b5993bcbd5081beb16ee8661f0c71574a0480546a63ee31fecf6e8b2bc5cd84e1
|
@@ -115,13 +115,29 @@ module Parliament
|
|
115
115
|
def statuses
|
116
116
|
return @statuses unless @statuses.nil?
|
117
117
|
|
118
|
+
statuses = {}
|
119
|
+
statuses[:house_membership_status] = house_membership_status
|
120
|
+
statuses[:general_membership_status] = general_membership_status
|
121
|
+
|
122
|
+
@statuses = statuses
|
123
|
+
end
|
124
|
+
|
125
|
+
private
|
126
|
+
|
127
|
+
def house_membership_status
|
118
128
|
statuses = []
|
119
129
|
statuses << 'Current MP' unless seat_incumbencies.select(&:current?).empty?
|
120
130
|
statuses << 'Lord' unless house_incumbencies.select(&:current?).empty?
|
121
131
|
statuses << 'Former Lord' if !house_incumbencies.empty? && house_incumbencies.select(&:current?).empty?
|
122
132
|
statuses << 'Former MP' if !seat_incumbencies.empty? && seat_incumbencies.select(&:current?).empty?
|
133
|
+
statuses
|
134
|
+
end
|
123
135
|
|
124
|
-
|
136
|
+
def general_membership_status
|
137
|
+
statuses = []
|
138
|
+
statuses << 'Current Member' unless incumbencies.select(&:current?).empty?
|
139
|
+
statuses << 'Former Member' if !incumbencies.empty? && incumbencies.select(&:current?).empty?
|
140
|
+
statuses
|
125
141
|
end
|
126
142
|
end
|
127
143
|
end
|
data/lib/parliament/response.rb
CHANGED
data/lib/parliament/version.rb
CHANGED