Sha256: 62bb57abee55a3cc3eb92413a5a0c29e6bb391909bc3fabcfaf6340e18101418

Contents?: true

Size: 1021 Bytes

Versions: 23

Compression:

Stored size: 1021 Bytes

Contents

module Parliament
  module Grom
    module Decorator
      # Decorator namespace for Grom::Node instances with type: https://id.parliament.uk/schema/GovRegisterGovernmentOrganisation.
      module GovRegisterGovernmentOrganisation
        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 start date of the Grom::Node or nil.
        def end_date
          @end_date ||= respond_to?(:groupEndDate) ? DateTime.parse(groupEndDate) : nil
        end

        # Alias groupName with fallback.
        #
        # @return [String, String] the name of the Grom::Node or an empty string.
        def name
          respond_to?(:groupName) ? groupName : ''
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
parliament-grom-decorators-0.32.1 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.32.0 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.31.1 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.31.0 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.31.0.pre.rc lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.30.0 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.29.0 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.27.7 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.27.6 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.27.5 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.27.4 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.27.3 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.27.2 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.27.1 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.27.0 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.26.0 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.25.1 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.25.0 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.24.0 lib/parliament/grom/decorator/gov_register_government_organisation.rb
parliament-grom-decorators-0.23.0 lib/parliament/grom/decorator/gov_register_government_organisation.rb