Class: Relaton::W3c::Processor

Inherits:
Core::Processor
  • Object
show all
Defined in:
lib/relaton/w3c/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/w3c/processor.rb', line 8

def initialize # rubocop:disable Lint/MissingSuper
  @short = :relaton_w3c
  @prefix = "W3C"
  @defaultprefix = %r{^W3C\s}
  @idtype = "W3C"
  @datasets = %w[w3c-api]
end

Instance Attribute Details

#idtypeObject (readonly)

Returns the value of attribute idtype.



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

def idtype
  @idtype
end

Instance Method Details

#fetch_data(_source, opts) ⇒ Object



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

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

#from_xml(xml) ⇒ Object



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

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

#from_yaml(yaml) ⇒ Object



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

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

#get(code, date, opts) ⇒ Object



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

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

#grammar_hashObject



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

def grammar_hash
  require_relative "../w3c"
  @grammar_hash ||= Relaton::W3c.grammar_hash
end

#remove_index_fileObject



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

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