Class: CocinaDisplay::Subjects::TemporalSubjectValue
- Inherits:
-
SubjectValue
- Object
- SubjectValue
- CocinaDisplay::Subjects::TemporalSubjectValue
- Defined in:
- lib/cocina_display/subjects/subject_value.rb
Overview
A subject value representing a date and/or time.
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
Attributes inherited from SubjectValue
Instance Method Summary collapse
-
#display_str ⇒ String
The formatted date/time string for display.
-
#initialize(cocina) ⇒ TemporalSubjectValue
constructor
A new instance of TemporalSubjectValue.
Methods inherited from SubjectValue
Constructor Details
#initialize(cocina) ⇒ TemporalSubjectValue
Returns a new instance of TemporalSubjectValue.
81 82 83 84 |
# File 'lib/cocina_display/subjects/subject_value.rb', line 81 def initialize(cocina) super @date = Dates::Date.from_cocina(cocina) end |
Instance Attribute Details
#date ⇒ Object (readonly)
Returns the value of attribute date.
79 80 81 |
# File 'lib/cocina_display/subjects/subject_value.rb', line 79 def date @date end |
Instance Method Details
#display_str ⇒ String
Returns The formatted date/time string for display.
87 88 89 |
# File 'lib/cocina_display/subjects/subject_value.rb', line 87 def display_str date.qualified_value end |