Class: Relaton::Bipm::Processor
- Inherits:
-
Core::Processor
- Object
- Core::Processor
- Relaton::Bipm::Processor
- Defined in:
- lib/relaton/bipm/processor.rb
Instance Attribute Summary collapse
-
#idtype ⇒ Object
readonly
Returns the value of attribute idtype.
Instance Method Summary collapse
-
#fetch_data(source, opts) ⇒ Object
Fetch all the documents from github.com/metanorma/bipm-data-outcomes, github.com/metanorma/bipm-si-brochure, github.com/relaton/rawdata-bipm-metrologia.
- #from_xml(xml) ⇒ RelatonBipm::BipmBibliographicItem
- #from_yaml(yaml) ⇒ Object
- #get(code, date, opts) ⇒ RelatonBipm::BipmBibliographicItem
-
#grammar_hash ⇒ String
Returns hash of XML grammar.
-
#initialize ⇒ Processor
constructor
A new instance of Processor.
-
#remove_index_file ⇒ Object
Remove index file.
Constructor Details
#initialize ⇒ Processor
Returns a new instance of Processor.
8 9 10 11 12 13 14 |
# File 'lib/relaton/bipm/processor.rb', line 8 def initialize @short = :relaton_bipm @prefix = "BIPM" @defaultprefix = %r{^(?:BIPM|CCTF|CCDS|CGPM|CIPM|JCRB|JCGM)(?!\w)} @idtype = "BIPM" @datasets = %w[bipm-data-outcomes bipm-si-brochure rawdata-bipm-metrologia] end |
Instance Attribute Details
#idtype ⇒ Object (readonly)
Returns the value of attribute idtype.
6 7 8 |
# File 'lib/relaton/bipm/processor.rb', line 6 def idtype @idtype end |
Instance Method Details
#fetch_data(source, opts) ⇒ Object
Fetch all the documents from github.com/metanorma/bipm-data-outcomes,
https://github.com/metanorma/bipm-si-brochure, https://github.com/relaton/rawdata-bipm-metrologia
35 36 37 38 |
# File 'lib/relaton/bipm/processor.rb', line 35 def fetch_data(source, opts) require_relative "data_fetcher" DataFetcher.fetch(source, **opts) end |
#from_xml(xml) ⇒ RelatonBipm::BipmBibliographicItem
42 43 44 45 |
# File 'lib/relaton/bipm/processor.rb', line 42 def from_xml(xml) require_relative "../bipm" Item.from_xml xml end |
#from_yaml(yaml) ⇒ Object
47 48 49 50 |
# File 'lib/relaton/bipm/processor.rb', line 47 def from_yaml(yaml) require_relative "../bipm" Item.from_yaml yaml end |
#get(code, date, opts) ⇒ RelatonBipm::BipmBibliographicItem
20 21 22 23 |
# File 'lib/relaton/bipm/processor.rb', line 20 def get(code, date, opts) require_relative "../bipm" Bibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
55 56 57 58 |
# File 'lib/relaton/bipm/processor.rb', line 55 def grammar_hash require_relative "../bipm" @grammar_hash ||= Relaton::Bipm.grammar_hash end |