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
-
#initialize(cocina) ⇒ NameSubjectValue
constructor
Initialize a NameSubjectValue object with Cocina structured data.
-
#to_s ⇒ String
Use the contributor name formatting rules for display.
Methods inherited from SubjectValue
atomic_types, from_cocina, split_pre_coordinated_values
Constructor Details
#initialize(cocina) ⇒ NameSubjectValue
Initialize a NameSubjectValue object with Cocina structured data.
63 64 65 66 |
# File 'lib/cocina_display/subjects/subject_value.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_value.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_value.rb', line 71 def to_s name.to_s(with_date: true) end |