Class: CocinaDisplay::Subjects::NameSubjectValue
- Inherits:
-
SubjectValue
- Object
- SubjectValue
- CocinaDisplay::Subjects::NameSubjectValue
- Defined in:
- lib/cocina_display/subjects/subject_value.rb
Overview
A subject value representing a named entity.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from SubjectValue
Instance Method Summary collapse
-
#display_str ⇒ String
Use the contributor name formatting rules for display.
-
#initialize(cocina) ⇒ NameSubjectValue
constructor
Initialize a NameSubjectValue object with Cocina structured data.
Methods inherited from SubjectValue
Constructor Details
#initialize(cocina) ⇒ NameSubjectValue
Initialize a NameSubjectValue object with Cocina structured data.
53 54 55 56 |
# File 'lib/cocina_display/subjects/subject_value.rb', line 53 def initialize(cocina) super @name = Contributors::Name.new(cocina) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
49 50 51 |
# File 'lib/cocina_display/subjects/subject_value.rb', line 49 def name @name end |
Instance Method Details
#display_str ⇒ String
Use the contributor name formatting rules for display.
61 62 63 |
# File 'lib/cocina_display/subjects/subject_value.rb', line 61 def display_str @name.display_str(with_date: true) end |