Class: CocinaDisplay::Events::Location
- Inherits:
-
Object
- Object
- CocinaDisplay::Events::Location
- Defined in:
- lib/cocina_display/events/location.rb
Overview
A single location represented in a Cocina event, like a publication place.
Instance Attribute Summary collapse
-
#cocina ⇒ Object
readonly
Returns the value of attribute cocina.
Instance Method Summary collapse
-
#display_str ⇒ String?
The name of the location.
-
#initialize(cocina) ⇒ Location
constructor
Initialize a Location object with Cocina structured data.
-
#unencoded_value? ⇒ Boolean
Is there an unencoded value (name) for this location?.
Constructor Details
#initialize(cocina) ⇒ Location
Initialize a Location object with Cocina structured data.
11 12 13 |
# File 'lib/cocina_display/events/location.rb', line 11 def initialize(cocina) @cocina = cocina end |
Instance Attribute Details
#cocina ⇒ Object (readonly)
Returns the value of attribute cocina.
7 8 9 |
# File 'lib/cocina_display/events/location.rb', line 7 def cocina @cocina end |
Instance Method Details
#display_str ⇒ String?
The name of the location. Decodes a MARC country code if present and no value was present.
18 19 20 |
# File 'lib/cocina_display/events/location.rb', line 18 def display_str cocina["value"] || decoded_country end |
#unencoded_value? ⇒ Boolean
Is there an unencoded value (name) for this location?
24 25 26 |
# File 'lib/cocina_display/events/location.rb', line 24 def unencoded_value? cocina["value"].present? end |