Module: Parliament::Decorators::Party

Defined in:
lib/parliament/decorators/party.rb

Overview

Decorator namespace for Grom::Node instances with type: id.ukpds.org/schema/Party

Instance Method Summary collapse

Instance Method Details

#member_countInteger?

Alias count with fallback.

Returns:

  • (Integer, nil)

    the count of members of the Grom::Node or nil.


22
23
24
# File 'lib/parliament/decorators/party.rb', line 22

def member_count
  respond_to?(:count) ? count.to_i : nil
end

#nameString

Alias partyName with fallback.

Returns:

  • (String, String)

    the party name of the Grom::Node or an empty string.


8
9
10
# File 'lib/parliament/decorators/party.rb', line 8

def name
  respond_to?(:partyName) ? partyName : ''
end

#party_membershipsArray

Alias partyHasPartyMembership with fallback.

Returns:

  • (Array, Array)

    the party memberships of the Grom::Node or an empty array.


15
16
17
# File 'lib/parliament/decorators/party.rb', line 15

def party_memberships
  respond_to?(:partyHasPartyMembership) ? partyHasPartyMembership : []
end