Module: Parliament::Grom::Decorator::FormalBody
- Includes:
- Helpers::DateHelper
- Defined in:
- lib/parliament/grom/decorator/formal_body.rb
Overview
Decorator namespace for Grom::Node instances with type: id.parliament.uk/schema/FormalBody.
Instance Method Summary collapse
-
#contact_points ⇒ Array
Checks if Grom::Node has contact points.
-
#current? ⇒ Boolean
Checks if Grom::Node has an end date.
-
#end_date ⇒ DateTime?
Alias formalBodyEndDate with fallback.
-
#has_chair? ⇒ Boolean
Checks if Grom::Node has a chair.
-
#joint? ⇒ Boolean
Checks if Grom::Node is joint.
-
#name ⇒ String
Checks if Grom::Node has a name.
-
#remit ⇒ String
Checks if Grom::Node has a remit.
-
#start_date ⇒ DateTime?
Alias formalBodyStartDate with fallback.
Methods included from Helpers::DateHelper
Instance Method Details
#contact_points ⇒ Array
Checks if Grom::Node has contact points.
60 61 62 |
# File 'lib/parliament/grom/decorator/formal_body.rb', line 60 def contact_points @contact_points ||= respond_to?(:formalBodyHasContactPoint) ? Array(formalBodyHasContactPoint) : [] end |
#current? ⇒ Boolean
Checks if Grom::Node has an end date.
53 54 55 |
# File 'lib/parliament/grom/decorator/formal_body.rb', line 53 def current? end_date.nil? end |
#end_date ⇒ DateTime?
Alias formalBodyEndDate with fallback.
46 47 48 |
# File 'lib/parliament/grom/decorator/formal_body.rb', line 46 def end_date @end_date ||= respond_to?(:formalBodyEndDate) ? DateTime.parse(formalBodyEndDate) : nil end |
#has_chair? ⇒ Boolean
Checks if Grom::Node has a chair.
18 19 20 |
# File 'lib/parliament/grom/decorator/formal_body.rb', line 18 def has_chair? respond_to?(:formalBodyHasFormalBodyChair) end |
#joint? ⇒ Boolean
Checks if Grom::Node is joint.
39 40 41 |
# File 'lib/parliament/grom/decorator/formal_body.rb', line 39 def joint? respond_to?(:formalBodyHasLeadHouse) end |
#name ⇒ String
Checks if Grom::Node has a name.
11 12 13 |
# File 'lib/parliament/grom/decorator/formal_body.rb', line 11 def name @name ||= respond_to?(:formalBodyName) ? formalBodyName : '' end |
#remit ⇒ String
Checks if Grom::Node has a remit.
32 33 34 |
# File 'lib/parliament/grom/decorator/formal_body.rb', line 32 def remit @remit ||= respond_to?(:formalBodyRemit) ? formalBodyRemit : '' end |
#start_date ⇒ DateTime?
Alias formalBodyStartDate with fallback.
25 26 27 |
# File 'lib/parliament/grom/decorator/formal_body.rb', line 25 def start_date @start_date ||= respond_to?(:formalBodyStartDate) ? DateTime.parse(formalBodyStartDate) : nil end |