Sha256: a827c7c1fe6851bbde6364c6c0ae29acb74102ed14f63092fcbe169d6aa29394
Contents?: true
Size: 898 Bytes
Versions: 17
Compression:
Stored size: 898 Bytes
Contents
module Parliament module Decorators module SeatIncumbency def start_date respond_to?(:incumbencyStartDate) ? DateTime.parse(incumbencyStartDate) : nil end def end_date respond_to?(:incumbencyEndDate) ? DateTime.parse(incumbencyEndDate) : nil end def seat respond_to?(:seatIncumbencyHasHouseSeat) ? seatIncumbencyHasHouseSeat.first : nil end def current? has_end_date = respond_to?(:incumbencyEndDate) !has_end_date end def house seat.nil? ? nil : seat.house end def constituency seat.nil? ? nil : seat.constituency end def contact_points respond_to?(:incumbencyHasContactPoint) ? incumbencyHasContactPoint : [] end def member respond_to?(:incumbencyHasMember) ? incumbencyHasMember.first : nil end end end end
Version data entries
17 entries across 17 versions & 1 rubygems