Sha256: 58ff31944f91e18e0578e08ff7ae25fca67dca10c17e04039cbff0f724a05a40

Contents?: true

Size: 531 Bytes

Versions: 5

Compression:

Stored size: 531 Bytes

Contents

module Parliament
  module Decorators
    module House
      def name
        respond_to?(:houseName) ? houseName : ''
      end

      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

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
parliament-ruby-0.4.1 lib/parliament/decorators/house.rb
parliament-ruby-0.4.0 lib/parliament/decorators/house.rb
parliament-ruby-0.3.0 lib/parliament/decorators/house.rb
parliament-ruby-0.2.2 lib/parliament/decorators/house.rb
parliament-ruby-0.2.1 lib/parliament/decorators/house.rb