Sha256: 32119eaf9ca2120c3a75bc94e1e064b5300f595da66a3d1f0bb43de2937832e9

Contents?: true

Size: 1019 Bytes

Versions: 38

Compression:

Stored size: 1019 Bytes

Contents

module Parliament
  module Grom
    module Decorator
      # Decorator namespace for Grom::Node instances with type: https://id.parliament.uk/schema/HouseSeat
      module HouseSeat
        # Alias houseSeatHasHouse with fallback.
        #
        # @return [Grom::Node, nil] the house of the Grom::Node or nil.
        def house
          respond_to?(:houseSeatHasHouse) ? houseSeatHasHouse.first : nil
        end

        # Alias houseSeatHasConstituencyGroup with fallback.
        #
        # @return [Grom::Node, nil] the constituency group of the Grom::Node or nil.
        def constituency
          respond_to?(:houseSeatHasConstituencyGroup) ? houseSeatHasConstituencyGroup.first : nil
        end

        # Alias houseSeatHasSeatIncumbency with fallback.
        #
        # @return [Array, Array] the seat incumbencies of the Grom::Node or an empty.
        def seat_incumbencies
          respond_to?(:houseSeatHasSeatIncumbency) ? houseSeatHasSeatIncumbency : []
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
parliament-grom-decorators-0.32.1 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.32.0 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.31.1 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.31.0 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.31.0.pre.rc lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.30.0 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.29.0 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.27.7 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.27.6 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.27.5 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.27.4 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.27.3 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.27.2 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.27.1 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.27.0 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.26.0 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.25.1 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.25.0 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.24.0 lib/parliament/grom/decorator/house_seat.rb
parliament-grom-decorators-0.23.0 lib/parliament/grom/decorator/house_seat.rb