Sha256: 2b039e568de495d62c678ee177dd761623f60227f81c56cf5e69485fd42c31d7

Contents?: true

Size: 959 Bytes

Versions: 1

Compression:

Stored size: 959 Bytes

Contents

module Parliament
  module Grom
    module Decorator
      # Decorator namespace for Grom::Node instances with type: https://id.parliament.uk/schema/WorkPackage
      module WorkPackage
        # Alias workPackageHasProcedure with fallback.
        # NB: Currently, work packages only have one procedure
        #
        # @return [Grom::Node, nil] a Procedure Grom::Node or nil.
        def procedure
          return @procedure if @procedure
          return nil unless respond_to?(:workPackageHasProcedure)

          @procedure = Helpers::Utils.type_safe_first(workPackageHasProcedure, Parliament::Grom::Decorator::Procedure)
        end

        def business_item
          return @business_item if @business_item
          return nil unless respond_to?(:workPackageHasBusinessItem)

          @business_item = Helpers::Utils.type_safe_first(workPackageHasBusinessItem, Parliament::Grom::Decorator::BusinessItem)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
parliament-grom-decorators-1.0.3 lib/parliament/grom/decorator/work_package.rb