Class: Cocina::Models::Mapping::FromMods::TitleBuilderStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/cocina/models/mapping/from_mods/title_builder_strategy.rb

Overview

Decides how to build a title based on whether this is a registered Hydrus object or not.

Class Method Summary collapse

Class Method Details

.find(label:) ⇒ #build

Returns a class that can build a title.

Parameters:

  • label (String)

Returns:

  • (#build)

    a class that can build a title



11
12
13
14
# File 'lib/cocina/models/mapping/from_mods/title_builder_strategy.rb', line 11

def self.find(label:)
  # Some hydrus items don't have titles, so using label. See https://github.com/sul-dlss/hydrus/issues/421
  label == 'Hydrus' ? HydrusDefaultTitleBuilder : Title
end