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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f8709189d173f05f7262e0c936f80fc95bed47b
4
- data.tar.gz: 5f7b9ef6a119ebe626494e982d97929ceb069a03
3
+ metadata.gz: 930448de54e0f6b6a8fe3c3e518e14da407b526f
4
+ data.tar.gz: 7fb8b49a94a465523517ef3b75a1b0fc6e5b94dc
5
5
  SHA512:
6
- metadata.gz: 23cb14e9a1d4ae565cce7a7f3930936fdb5d3f38f03eee594dec3ed14c39ea919d2bec91ac5124b8225c68f3671d7e412712ef1d7b33582f3656ae31101dde6e
7
- data.tar.gz: bee983980f773fc552d6366e4626ff9cb337626226f89cb382a0eb83768c05ad4051a55215288b70f36bcaebb3b78a77eeee735e1c6e674053793fe496c4552b
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
@@ -1,7 +1,7 @@
1
1
  module Parliament
2
2
  module Grom
3
3
  module Decorator
4
- VERSION = '0.1.3'.freeze
4
+ VERSION = '0.1.4'.freeze
5
5
  end
6
6
  end
7
7
  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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rebecca Appleyard