Class: DorIndexing::Builders::AllSearchTextBuilder

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

Overview

Extracts useful text for searching from Cocina Description

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cocina_description) ⇒ AllSearchTextBuilder

Returns a new instance of AllSearchTextBuilder.



11
12
13
# File 'lib/dor_indexing/builders/all_search_text_builder.rb', line 11

def initialize(cocina_description)
  @cocina_description = cocina_description
end

Class Method Details

.build(cocina_description) ⇒ Object



7
8
9
# File 'lib/dor_indexing/builders/all_search_text_builder.rb', line 7

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

Instance Method Details

#buildObject



15
16
17
18
19
# File 'lib/dor_indexing/builders/all_search_text_builder.rb', line 15

def build
  @text = []
  recurse(cocina_description)
  text.join(' ')
end