Class: CocinaDisplay::Subjects::PlaceSubjectValue
- Inherits:
-
SubjectValue
- Object
- SubjectValue
- CocinaDisplay::Subjects::PlaceSubjectValue
- Defined in:
- lib/cocina_display/subjects/subject_value.rb
Overview
A subject value representing a named place.
Instance Attribute Summary
Attributes inherited from SubjectValue
Instance Method Summary collapse
-
#geonames? ⇒ Boolean
True if the place has a geonames.org URI.
-
#geonames_id ⇒ String?
Unique identifier for the place in geonames.org.
-
#uri ⇒ String?
A URI identifying the place, if available.
Methods inherited from SubjectValue
atomic_types, from_cocina, #initialize, #to_s
Constructor Details
This class inherits a constructor from CocinaDisplay::Subjects::SubjectValue
Instance Method Details
#geonames? ⇒ Boolean
True if the place has a geonames.org URI.
102 103 104 |
# File 'lib/cocina_display/subjects/subject_value.rb', line 102 def geonames? uri&.include?("sws.geonames.org") end |
#geonames_id ⇒ String?
Unique identifier for the place in geonames.org.
108 109 110 |
# File 'lib/cocina_display/subjects/subject_value.rb', line 108 def geonames_id uri&.split("/")&.last if geonames? end |
#uri ⇒ String?
A URI identifying the place, if available.
96 97 98 |
# File 'lib/cocina_display/subjects/subject_value.rb', line 96 def uri cocina["uri"] end |