Class: Glossarist::Sts::TermMapper

Inherits:
Object
  • Object
show all
Defined in:
lib/glossarist/sts/term_mapper.rb

Instance Method Summary collapse

Instance Method Details

#map(extracted_term) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/glossarist/sts/term_mapper.rb', line 6

def map(extracted_term)
  concept_id = extracted_term.label || extracted_term.id

  mc = Glossarist::ManagedConcept.new(data: { id: concept_id })

  extracted_term.lang_sets.each do |ls|
    mc.add_localization(build_localized_concept(ls,
                                                extracted_term.source_ref))
  end

  mc
end