Class: Relaton::Xsf::Processor

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeProcessor

rubocop:disable Lint/MissingSuper



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

def initialize # rubocop:disable Lint/MissingSuper
  @short = :relaton_xsf
  @prefix = "XEP"
  @defaultprefix = %r{^XEP\s}
  @idtype = "XEP"
  @datasets = %w[xep-xmpp]
end

Instance Attribute Details

#idtypeObject (readonly)

Returns the value of attribute idtype.



7
8
9
# File 'lib/relaton/xsf/processor.rb', line 7

def idtype
  @idtype
end

Instance Method Details

#fetch_data(_source, opts) ⇒ Object



22
23
24
25
# File 'lib/relaton/xsf/processor.rb', line 22

def fetch_data(_source, opts)
  require_relative "data_fetcher"
  Relaton::Xsf::DataFetcher.fetch(**opts)
end

#from_xml(xml) ⇒ Object



27
28
29
30
# File 'lib/relaton/xsf/processor.rb', line 27

def from_xml(xml)
  require_relative "../xsf"
  Relaton::Xsf::Item.from_xml(xml)
end

#from_yaml(yaml) ⇒ Object



32
33
34
35
# File 'lib/relaton/xsf/processor.rb', line 32

def from_yaml(yaml)
  require_relative "../xsf"
  Relaton::Xsf::Item.from_yaml(yaml)
end

#get(code, date, opts) ⇒ Object



17
18
19
20
# File 'lib/relaton/xsf/processor.rb', line 17

def get(code, date, opts)
  require_relative "../xsf"
  Relaton::Xsf::Bibliography.get(code, date, opts)
end

#grammar_hashObject



37
38
39
40
# File 'lib/relaton/xsf/processor.rb', line 37

def grammar_hash
  require_relative "../xsf"
  Relaton::Xsf.grammar_hash
end

#remove_index_fileObject



42
43
44
45
46
47
# File 'lib/relaton/xsf/processor.rb', line 42

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