Sha256: 863c8e156f402452084164f64a643469d21bda7872d67dc75189b8a252162d29

Contents?: true

Size: 948 Bytes

Versions: 9

Compression:

Stored size: 948 Bytes

Contents

module Parliament
  module Decorator
    # Decorator namespace for Grom::Node instances with type: http://id.ukpds.org/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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
parliament-ruby-0.7.4 lib/parliament/decorator/house_seat.rb
parliament-ruby-0.7.3.pre lib/parliament/decorator/house_seat.rb
parliament-ruby-0.7.2.pre lib/parliament/decorator/house_seat.rb
parliament-ruby-0.7.1.pre lib/parliament/decorator/house_seat.rb
parliament-ruby-0.7.0.pre lib/parliament/decorator/house_seat.rb
parliament-ruby-0.6.3 lib/parliament/decorator/house_seat.rb
parliament-ruby-0.6.2 lib/parliament/decorator/house_seat.rb
parliament-ruby-0.6.1 lib/parliament/decorator/house_seat.rb
parliament-ruby-0.6.0 lib/parliament/decorator/house_seat.rb