Sha256: fe85507f539e27ccd70d92c7d851d32447c722267fad8b9c3b76a2b6cea27ebb

Contents?: true

Size: 922 Bytes

Versions: 8

Compression:

Stored size: 922 Bytes

Contents

module Parliament
  module Grom
    module Decorator
      # Decorator namespace for Grom::Node instances with type: https://id.parliament.uk/schema/Laying
      module Laying
        # Alias layingDate with fallback.
        #
        # @return [Date, nil] the date of the Grom::Node or nil.
        def date
          respond_to?(:layingDate) ? DateTime.parse(layingDate) : nil
        end

        # Alias layingHasLayingBody with fallback.
        #
        # @return [Grom::Node, nil] the LayingBody of the Grom::Node or nil.
        def body
          respond_to?(:layingHasLayingBody) ? layingHasLayingBody.first : nil
        end

        # Alias layingHasLayingPerson with fallback.
        #
        # @return [Grom::Node, nil] the LayingPerson of the Grom::Node or nil.
        def person
          respond_to?(:layingHasLayingPerson) ? layingHasLayingPerson.first : nil
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
parliament-grom-decorators-0.32.1 lib/parliament/grom/decorator/laying.rb
parliament-grom-decorators-0.32.0 lib/parliament/grom/decorator/laying.rb
parliament-grom-decorators-0.31.1 lib/parliament/grom/decorator/laying.rb
parliament-grom-decorators-0.31.0 lib/parliament/grom/decorator/laying.rb
parliament-grom-decorators-0.31.0.pre.rc lib/parliament/grom/decorator/laying.rb
parliament-grom-decorators-0.30.0 lib/parliament/grom/decorator/laying.rb
parliament-grom-decorators-0.29.0 lib/parliament/grom/decorator/laying.rb
parliament-grom-decorators-0.27.7 lib/parliament/grom/decorator/laying.rb