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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5be3624320b2e71f2c866d40afafe52136efeff5
4
- data.tar.gz: 42f22e3125fad051a6136ab25c94cccd50826aea
3
+ metadata.gz: 2d14dd3dc4a909bd1a4b34c91cd3f1db63fead1e
4
+ data.tar.gz: cf3facc1bdb12d813549b80bf52a2d128eddf15c
5
5
  SHA512:
6
- metadata.gz: f7ef3458bf75e223766b6a0d0e6e8e1c8b9604bd49afd74883aab3b40cc2b252ad8ea41e372e32b833418a5ae679ab5ddb3a2853c07c4c26bb9e0e425830a9f2
7
- data.tar.gz: 245c285b50a42044f4791439e3081365ecd8e2933a9a80e4e1afd153569348fa5ad6ee255fb7b0f92ced6c22d71b182f92f8f802c6bf2132badc84ba745908ca
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
- @statuses = statuses
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
@@ -47,5 +47,9 @@ module Parliament
47
47
 
48
48
  rejected.concat(grom_nodes)
49
49
  end
50
+
51
+ def reverse_sort_by(*parameters)
52
+ sort_by(*parameters).reverse!
53
+ end
50
54
  end
51
55
  end
@@ -1,3 +1,3 @@
1
1
  module Parliament
2
- VERSION = '0.5.7'.freeze
2
+ VERSION = '0.5.8'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parliament-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Rayner