Module: Parliament::Decorators::House

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

Overview

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

Instance Method Summary collapse

Instance Method Details

#house_incumbenciesArray

Alias houseHasHouseIncumbency with fallback.


36
37
38
# File 'lib/parliament/decorators/house.rb', line 36

def house_incumbencies
  respond_to?(:houseHasHouseIncumbency) ? houseHasHouseIncumbency : []
end

#nameString

Alias houseName with fallback.


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

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

#seat_incumbenciesArray

Alias houseSeatHasSeatIncumbency with fallback.


15
16
17
18
19
20
21
22
23
24
# File 'lib/parliament/decorators/house.rb', line 15

def seat_incumbencies
  return @seat_incumbencies unless @seat_incumbencies.nil?

  seat_incumbencies = []
  seats.each do |seat|
    seat_incumbencies << seat.seat_incumbencies
  end

  @seat_incumbencies = seat_incumbencies.flatten.uniq
end

#seatsArray

Alias houseHasHouseSeat with fallback.


29
30
31
# File 'lib/parliament/decorators/house.rb', line 29

def seats
  respond_to?(:houseHasHouseSeat) ? houseHasHouseSeat : []
end