Module: CocinaDisplay::Concerns::Druid
- Included in:
- CocinaDisplay::CocinaRecord
- Defined in:
- lib/cocina_display/concerns/druid.rb
Overview
Methods for extracting and formatting identifiers from Cocina records.
Instance Method Summary collapse
-
#bare_druid ⇒ String?
The DRUID for the object, without the
druid:prefix. -
#druid ⇒ String?
The DRUID for the object, with the
druid:prefix.
Instance Method Details
#bare_druid ⇒ String?
Note:
A RelatedResource may not have a DRUID.
The DRUID for the object, without the druid: prefix.
19 20 21 |
# File 'lib/cocina_display/concerns/druid.rb', line 19 def druid.delete_prefix("druid:") end |
#druid ⇒ String?
Note:
A RelatedResource may not have a DRUID, but could have a purl URL.
The DRUID for the object, with the druid: prefix.
10 11 12 |
# File 'lib/cocina_display/concerns/druid.rb', line 10 def druid cocina_doc["externalIdentifier"] end |