Sha256: c1690d898c441d6d01736574e0c298890917af04ee4ce4be79f855d45e089ad9

Contents?: true

Size: 749 Bytes

Versions: 7

Compression:

Stored size: 749 Bytes

Contents

module Parliament
  module Grom
    module Decorator
      # Decorator namespace for Grom::Node instances with type: https://id.parliament.uk/schema/Group.
      module Group
        include Helpers::DateHelper

        # Alias groupStartDate with fallback.
        #
        # @return [DateTime, nil] the start date of the Grom::Node or nil.
        def start_date
          @start_date ||= respond_to?(:groupStartDate) ? DateTime.parse(groupStartDate) : nil
        end

        # Alias groupEndDate with fallback.
        #
        # @return [DateTime, nil] the end date of the Grom::Node or nil.
        def end_date
          @end_date ||= respond_to?(:groupEndDate) ? DateTime.parse(groupEndDate) : nil
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
parliament-grom-decorators-1.0.6 lib/parliament/grom/decorator/group.rb
parliament-grom-decorators-1.0.5 lib/parliament/grom/decorator/group.rb
parliament-grom-decorators-1.0.4 lib/parliament/grom/decorator/group.rb
parliament-grom-decorators-1.0.3 lib/parliament/grom/decorator/group.rb
parliament-grom-decorators-1.0.2 lib/parliament/grom/decorator/group.rb
parliament-grom-decorators-1.0.0 lib/parliament/grom/decorator/group.rb
parliament-grom-decorators-1.0.0.pre.pre lib/parliament/grom/decorator/group.rb