Module: Parliament::Grom::Decorator::Group

Includes:
Helpers::DateHelper
Defined in:
lib/parliament/grom/decorator/group.rb

Overview

Decorator namespace for Grom::Node instances with type: id.parliament.uk/schema/Group.

Since:

  • 0.1.0

Instance Method Summary collapse

Methods included from Helpers::DateHelper

#date_range

Instance Method Details

#end_dateDateTime?

Alias groupEndDate with fallback.

Returns:

  • (DateTime, nil)

    the end date of the Grom::Node or nil.

Since:

  • 0.1.0



18
19
20
# File 'lib/parliament/grom/decorator/group.rb', line 18

def end_date
  @end_date ||= respond_to?(:groupEndDate) ? DateTime.parse(groupEndDate) : nil
end

#start_dateDateTime?

Alias groupStartDate with fallback.

Returns:

  • (DateTime, nil)

    the start date of the Grom::Node or nil.

Since:

  • 0.1.0



11
12
13
# File 'lib/parliament/grom/decorator/group.rb', line 11

def start_date
  @start_date ||= respond_to?(:groupStartDate) ? DateTime.parse(groupStartDate) : nil
end