Class: DorIndexing::Builders::EventPlaceBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/dor_indexing/builders/event_place_builder.rb

Overview

Finds the place to index from publication events

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event) ⇒ EventPlaceBuilder

Returns a new instance of EventPlaceBuilder.



13
14
15
# File 'lib/dor_indexing/builders/event_place_builder.rb', line 13

def initialize(event)
  @event = event
end

Class Method Details

.build(event) ⇒ String

Returns the place value for Solr.

Parameters:

  • event (Cocina::Models::Event)

Returns:

  • (String)

    the place value for Solr



9
10
11
# File 'lib/dor_indexing/builders/event_place_builder.rb', line 9

def self.build(event)
  new(event).build
end

Instance Method Details

#buildObject



17
18
19
20
21
# File 'lib/dor_indexing/builders/event_place_builder.rb', line 17

def build
  return unless event

  primary_location || location_from(flat_locations)
end