Class: CocinaDisplay::Notes::Note

Inherits:
Parallel::Parallel show all
Defined in:
lib/cocina_display/notes/note.rb

Overview

A note associated with a cocina record

Instance Attribute Summary

Attributes inherited from Parallel::Parallel

#cocina

Instance Method Summary collapse

Methods inherited from Parallel::Parallel

#has_translation?, #has_transliteration?, #has_vernacular?, #initialize, #main_value, #own_type, #own_typed?, #parallel_values, #primary?, #status, #translated_value, #transliterated_value, #type, #typed?, #vernacular_value

Constructor Details

This class inherits a constructor from CocinaDisplay::Parallel::Parallel

Instance Method Details

#labelString

Label used to render the note for display. Uses a displayLabel if available, otherwise tries to look up via type. Falls back to a default label derived from the type or a generic note label if no type is set.

Returns:

  • (String)


17
18
19
20
# File 'lib/cocina_display/notes/note.rb', line 17

def label
  display_label ||
    I18n.t(type&.parameterize&.underscore, default: default_label, scope: "cocina_display.field_label.note")
end