Class: CocinaDisplay::Titles::Title
- Inherits:
-
Parallel::Parallel
- Object
- Parallel::Parallel
- CocinaDisplay::Titles::Title
- Defined in:
- lib/cocina_display/titles/title.rb
Overview
A Title represented by one or more TitleValues in various languages/scripts.
Instance Attribute Summary collapse
-
#part_label ⇒ Object
readonly
Part data for digital serials, coming from elsewhere in the Cocina.
-
#part_numbers ⇒ Object
readonly
Part data for digital serials, coming from elsewhere in the Cocina.
Attributes inherited from Parallel::Parallel
Instance Method Summary collapse
-
#initialize(cocina, part_label: nil, part_numbers: nil) ⇒ Title
constructor
Create a new Title object.
-
#label ⇒ String
Label used when displaying the title.
-
#to_s ⇒ String?
The string representation of the title, for display.
Methods inherited from Parallel::Parallel
#has_translation?, #has_transliteration?, #has_vernacular?, #main_value, #own_type, #own_typed?, #parallel_values, #primary?, #status, #translated_value, #transliterated_value, #type, #typed?, #vernacular_value
Constructor Details
#initialize(cocina, part_label: nil, part_numbers: nil) ⇒ Title
Create a new Title object.
16 17 18 19 20 |
# File 'lib/cocina_display/titles/title.rb', line 16 def initialize(cocina, part_label: nil, part_numbers: nil) super(cocina) @part_label = part_label @part_numbers = part_numbers end |
Instance Attribute Details
#part_label ⇒ Object (readonly)
Part data for digital serials, coming from elsewhere in the Cocina.
6 7 8 |
# File 'lib/cocina_display/titles/title.rb', line 6 def part_label @part_label end |
#part_numbers ⇒ Object (readonly)
Part data for digital serials, coming from elsewhere in the Cocina.
6 7 8 |
# File 'lib/cocina_display/titles/title.rb', line 6 def part_numbers @part_numbers end |
Instance Method Details
#label ⇒ String
Label used when displaying the title.
24 25 26 |
# File 'lib/cocina_display/titles/title.rb', line 24 def label display_label || type_label end |
#to_s ⇒ String?
The string representation of the title, for display.
30 31 32 |
# File 'lib/cocina_display/titles/title.rb', line 30 def to_s display_title end |