Module: Parliament::Grom::Decorator::HouseIncumbency
- Defined in:
- lib/parliament/grom/decorator/house_incumbency.rb
Overview
Decorator namespace for Grom::Node instances with type: id.parliament.uk/schema/HouseIncumbency
Instance Method Summary collapse
-
#contact_points ⇒ Array
Alias parliamentaryIncumbencyHasContactPoint with fallback.
-
#current? ⇒ Boolean
Checks if Grom::Node has an end date.
-
#end_date ⇒ DateTime?
Alias parliamentaryIncumbencyEndDate with fallback.
-
#house ⇒ Grom::Node?
Alias houseIncumbencyHasHouse with fallback.
-
#member ⇒ Grom::Node?
Alias parliamentaryIncumbencyHasMember with fallback.
-
#start_date ⇒ DateTime?
Alias parliamentaryIncumbencyStartDate with fallback.
Methods included from Parliament::Grom::Decorator::Helpers::DateHelper
Instance Method Details
#contact_points ⇒ Array
Alias parliamentaryIncumbencyHasContactPoint with fallback.
46 47 48 |
# File 'lib/parliament/grom/decorator/house_incumbency.rb', line 46 def contact_points respond_to?(:parliamentaryIncumbencyHasContactPoint) ? parliamentaryIncumbencyHasContactPoint : [] end |
#current? ⇒ Boolean
Checks if Grom::Node has an end date.
25 26 27 |
# File 'lib/parliament/grom/decorator/house_incumbency.rb', line 25 def current? end_date.nil? end |
#end_date ⇒ DateTime?
Alias parliamentaryIncumbencyEndDate with fallback.
18 19 20 |
# File 'lib/parliament/grom/decorator/house_incumbency.rb', line 18 def end_date @end_date ||= respond_to?(:parliamentaryIncumbencyEndDate) ? DateTime.parse(parliamentaryIncumbencyEndDate) : nil end |
#house ⇒ Grom::Node?
Alias houseIncumbencyHasHouse with fallback.
32 33 34 |
# File 'lib/parliament/grom/decorator/house_incumbency.rb', line 32 def house respond_to?(:houseIncumbencyHasHouse) ? houseIncumbencyHasHouse.first : nil end |
#member ⇒ Grom::Node?
Alias parliamentaryIncumbencyHasMember with fallback.
39 40 41 |
# File 'lib/parliament/grom/decorator/house_incumbency.rb', line 39 def member respond_to?(:parliamentaryIncumbencyHasMember) ? parliamentaryIncumbencyHasMember.first : nil end |
#start_date ⇒ DateTime?
Alias parliamentaryIncumbencyStartDate with fallback.
11 12 13 |
# File 'lib/parliament/grom/decorator/house_incumbency.rb', line 11 def start_date @start_date ||= respond_to?(:parliamentaryIncumbencyStartDate) ? DateTime.parse(parliamentaryIncumbencyStartDate) : nil end |