Class: Relaton::Plateau::Processor

Inherits:
Core::Processor
  • Object
show all
Defined in:
lib/relaton/plateau/processor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeProcessor

rubocop:disable Lint/MissingSuper



8
9
10
11
12
13
14
# File 'lib/relaton/plateau/processor.rb', line 8

def initialize # rubocop:disable Lint/MissingSuper
  @short = :relaton_plateau
  @prefix = "PLATEAU"
  @defaultprefix = /^PLATEAU\s/
  @idtype = "PLATEAU"
  @datasets = %w[plateau-handbooks plateau-technical-reports]
end

Instance Attribute Details

#idtypeObject (readonly)

Returns the value of attribute idtype.



6
7
8
# File 'lib/relaton/plateau/processor.rb', line 6

def idtype
  @idtype
end

Instance Method Details

#fetch_data(source, opts) ⇒ Object



21
22
23
24
# File 'lib/relaton/plateau/processor.rb', line 21

def fetch_data(source, opts)
  require_relative "data_fetcher"
  DataFetcher.fetch(source, **opts)
end

#from_xml(xml) ⇒ Object



26
27
28
29
# File 'lib/relaton/plateau/processor.rb', line 26

def from_xml(xml)
  require_relative "../plateau"
  Item.from_xml xml
end

#from_yaml(yaml) ⇒ Object



31
32
33
34
# File 'lib/relaton/plateau/processor.rb', line 31

def from_yaml(yaml)
  require_relative "../plateau"
  Item.from_yaml yaml
end

#get(code, date, opts) ⇒ Object



16
17
18
19
# File 'lib/relaton/plateau/processor.rb', line 16

def get(code, date, opts)
  require_relative "../plateau"
  Bibliography.get(code, date, opts)
end

#grammar_hashObject



36
37
38
39
# File 'lib/relaton/plateau/processor.rb', line 36

def grammar_hash
  require_relative "../plateau"
  @grammar_hash ||= ::Relaton::Plateau.grammar_hash
end

#remove_index_fileObject



43
44
45
46
# File 'lib/relaton/plateau/processor.rb', line 43

def remove_index_file
  require_relative "../plateau"
  Relaton::Index.find_or_create(:plateau, url: true, file: "#{INDEXFILE}.yaml").remove_file
end

#threadsObject



41
# File 'lib/relaton/plateau/processor.rb', line 41

def threads = 3