Class: CocinaDisplay::Subjects::NameSubjectPart
- Inherits:
-
SubjectPart
- Object
- SubjectPart
- CocinaDisplay::Subjects::NameSubjectPart
- Defined in:
- lib/cocina_display/subjects/subject_part.rb
Overview
A subject part representing a named entity.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from SubjectPart
Instance Method Summary collapse
-
#initialize(cocina) ⇒ NameSubjectPart
constructor
Initialize a NameSubjectPart object with Cocina structured data.
-
#to_s ⇒ String
Use the contributor name formatting rules for display.
Methods inherited from SubjectPart
atomic_types, from_cocina, split_pre_coordinated_values
Constructor Details
#initialize(cocina) ⇒ NameSubjectPart
Initialize a NameSubjectPart object with Cocina structured data.
63 64 65 66 |
# File 'lib/cocina_display/subjects/subject_part.rb', line 63 def initialize(cocina) super @name = Contributors::Name.new(cocina) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
59 60 61 |
# File 'lib/cocina_display/subjects/subject_part.rb', line 59 def name @name end |
Instance Method Details
#to_s ⇒ String
Use the contributor name formatting rules for display.
71 72 73 |
# File 'lib/cocina_display/subjects/subject_part.rb', line 71 def to_s name.to_s(with_date: true) end |