Module: Parliament::Grom::Decorator::HouseSeat

Defined in:
lib/parliament/grom/decorator/house_seat.rb

Overview

Decorator namespace for Grom::Node instances with type: id.parliament.uk/schema/HouseSeat

Since:

  • 0.1.0

Instance Method Summary collapse

Instance Method Details

#constituencyGrom::Node?

Alias houseSeatHasConstituencyGroup with fallback.

Returns:

  • (Grom::Node, nil)

    the constituency group of the Grom::Node or nil.

Since:

  • 0.1.0



16
17
18
# File 'lib/parliament/grom/decorator/house_seat.rb', line 16

def constituency
  respond_to?(:houseSeatHasConstituencyGroup) ? houseSeatHasConstituencyGroup.first : nil
end

#houseGrom::Node?

Alias houseSeatHasHouse with fallback.

Returns:

  • (Grom::Node, nil)

    the house of the Grom::Node or nil.

Since:

  • 0.1.0



9
10
11
# File 'lib/parliament/grom/decorator/house_seat.rb', line 9

def house
  respond_to?(:houseSeatHasHouse) ? houseSeatHasHouse.first : nil
end

#seat_incumbenciesArray

Alias houseSeatHasSeatIncumbency with fallback.

Returns:

  • (Array, Array)

    the seat incumbencies of the Grom::Node or an empty.

Since:

  • 0.1.0



23
24
25
# File 'lib/parliament/grom/decorator/house_seat.rb', line 23

def seat_incumbencies
  respond_to?(:houseSeatHasSeatIncumbency) ? houseSeatHasSeatIncumbency : []
end