Class: Relaton::Bib::Converter::Bibtex::FromBibtex

Inherits:
Object
  • Object
show all
Defined in:
lib/relaton/bib/converter/bibtex/from_bibtex.rb

Instance Method Summary collapse

Constructor Details

#initialize(entry) ⇒ FromBibtex

Returns a new instance of FromBibtex.

Parameters:

  • entry (BibTeX::Entry)


7
8
9
# File 'lib/relaton/bib/converter/bibtex/from_bibtex.rb', line 7

def initialize(entry)
  @entry = entry
end

Instance Method Details

#transformRelaton::Bib::ItemData



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/relaton/bib/converter/bibtex/from_bibtex.rb', line 12

def transform # rubocop:disable Metrics/MethodLength
  ItemData.new(
    id: @entry.key,
    docidentifier: fetch_docid,
    fetched: fetch_fetched,
    type: fetch_type,
    title: fetch_title,
    contributor: fetch_contributor,
    date: fetch_date,
    place: fetch_place,
    note: fetch_note,
    relation: fetch_relation,
    extent: fetch_extent,
    edition: fetch_edition,
    series: fetch_series,
    source: fetch_link,
    language: fetch_language,
    classification: fetch_classification,
    keyword: fetch_keyword,
  )
end