Sha256: b4b8b2300baeed36c36ca36e861ce170b75b77faa7850e9c8caf89dee36dbdf8
Contents?: true
Size: 861 Bytes
Versions: 10
Compression:
Stored size: 861 Bytes
Contents
# frozen_string_literal: true module ModsDisplay module RelatedItemConcerns private def render_nested_related_item?(item) related_item_is_a_constituent?(item) || related_item_is_host?(item) end def related_item_is_a_collection?(item) item.respond_to?(:titleInfo) && item.respond_to?(:typeOfResource) && !item.typeOfResource.attributes.empty? && item.typeOfResource.attributes.first.key?('collection') && item.typeOfResource.attributes.first['collection'].value == 'yes' end def related_item_is_a_constituent?(item) item.attributes['type'].respond_to?(:value) && item.attributes['type'].value == 'constituent' end def related_item_is_host?(item) item.attributes['type'].respond_to?(:value) && item.attributes['type'].value == 'host' end end end
Version data entries
10 entries across 10 versions & 1 rubygems