Module: CocinaDisplay::Concerns::ContentType
- Included in:
- CocinaDisplay::CocinaRecord, RelatedResource
- Defined in:
- lib/cocina_display/concerns/content_type.rb
Overview
Methods related to the content type of a Cocina object.
Instance Method Summary collapse
-
#collection? ⇒ Boolean
True if the object is a collection.
-
#content_type ⇒ String?
SDR content type of the object.
Instance Method Details
#collection? ⇒ Boolean
True if the object is a collection.
16 17 18 |
# File 'lib/cocina_display/concerns/content_type.rb', line 16 def collection? content_type == "collection" end |
#content_type ⇒ String?
SDR content type of the object.
10 11 12 |
# File 'lib/cocina_display/concerns/content_type.rb', line 10 def content_type cocina_doc["type"]&.delete_prefix("https://cocina.sul.stanford.edu/models/") end |