parliament-grom-decorators 0.1.1 → 0.1.2
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: 0e860f1e6fc16912229ea7d63e2d5ba81bfae8fc
|
4
|
+
data.tar.gz: ff70e5e6e30483aac559146677930509e61353d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c7208e840ab9926e192bc34c75473d79f48389fb0dcaced447d4bda23b5d5d9e816583e9b767cd7ff349f4ef19865ffa3acd46d887790912d22c7242ab7e2ce
|
7
|
+
data.tar.gz: 4b2aed63bf20e08f1fd18941251b659a9c68d4efba10e44fd782f48103d69ba6bdf8f818ec62fec628af631d2b6f1852eb907e0ff6d666849ed66ef34117cebd
|
@@ -98,6 +98,34 @@ module Parliament
|
|
98
98
|
def correct?
|
99
99
|
@correct || false
|
100
100
|
end
|
101
|
+
|
102
|
+
# Alias incumbencyHasMember with fallback.
|
103
|
+
#
|
104
|
+
# @return [Array, Array] the current member of the Grom::Node has a display name.
|
105
|
+
|
106
|
+
def current_member_display_name
|
107
|
+
return @current_member_display_name unless @current_member_display_name.nil?
|
108
|
+
current_incumbency = seat_incumbencies.select(&:current?).first
|
109
|
+
@current_member_display_name = current_incumbency.nil? ? nil : current_incumbency.member.display_name
|
110
|
+
end
|
111
|
+
|
112
|
+
# Alias party_name with fallback.
|
113
|
+
#
|
114
|
+
# @return [String, String] the name of the Grom::Node or an empty string.
|
115
|
+
|
116
|
+
def current_member_party_name
|
117
|
+
return @party_name unless @party_name.nil?
|
118
|
+
current_incumbency = seat_incumbencies.select(&:current?).first
|
119
|
+
|
120
|
+
if current_incumbency
|
121
|
+
current_membership = current_incumbency.member.party_memberships.select(&:current?).first
|
122
|
+
@party_name = current_membership.nil? ? nil : current_membership.party.name
|
123
|
+
else
|
124
|
+
@party_name = nil
|
125
|
+
end
|
126
|
+
@party_name
|
127
|
+
end
|
128
|
+
|
101
129
|
end
|
102
130
|
end
|
103
131
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parliament-grom-decorators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rebecca Appleyard
|
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
177
|
version: '0'
|
178
178
|
requirements: []
|
179
179
|
rubyforge_project:
|
180
|
-
rubygems_version: 2.6.
|
180
|
+
rubygems_version: 2.6.11
|
181
181
|
signing_key:
|
182
182
|
specification_version: 4
|
183
183
|
summary: Parliamentary Grom decorator
|