Class: Relaton::Jis::Processor
- Inherits:
-
Core::Processor
- Object
- Core::Processor
- Relaton::Jis::Processor
- Defined in:
- lib/relaton/jis/processor.rb
Instance Attribute Summary collapse
-
#idtype ⇒ Object
readonly
Returns the value of attribute idtype.
Instance Method Summary collapse
- #fetch_data(_source, opts) ⇒ Object
- #from_xml(xml) ⇒ Object
- #from_yaml(yaml) ⇒ Object
- #get(code, date, opts) ⇒ Object
- #grammar_hash ⇒ Object
-
#initialize ⇒ Processor
constructor
rubocop:disable Lint/MissingSuper.
- #remove_index_file ⇒ Object
- #threads ⇒ Object
Constructor Details
#initialize ⇒ Processor
rubocop:disable Lint/MissingSuper
10 11 12 13 14 15 16 |
# File 'lib/relaton/jis/processor.rb', line 10 def initialize # rubocop:disable Lint/MissingSuper @short = :relaton_jis @prefix = "JIS" @defaultprefix = %r{^(JIS|TR)\s} @idtype = "JIS" @datasets = %w[jis-webdesk] end |
Instance Attribute Details
#idtype ⇒ Object (readonly)
Returns the value of attribute idtype.
8 9 10 |
# File 'lib/relaton/jis/processor.rb', line 8 def idtype @idtype end |
Instance Method Details
#fetch_data(_source, opts) ⇒ Object
23 24 25 26 |
# File 'lib/relaton/jis/processor.rb', line 23 def fetch_data(_source, opts) require_relative "data_fetcher" DataFetcher.fetch(**opts) end |
#from_xml(xml) ⇒ Object
28 29 30 31 |
# File 'lib/relaton/jis/processor.rb', line 28 def from_xml(xml) require_relative "../jis" Item.from_xml xml end |
#from_yaml(yaml) ⇒ Object
33 34 35 36 |
# File 'lib/relaton/jis/processor.rb', line 33 def from_yaml(yaml) require_relative "../jis" Item.from_yaml yaml end |
#get(code, date, opts) ⇒ Object
18 19 20 21 |
# File 'lib/relaton/jis/processor.rb', line 18 def get(code, date, opts) require_relative "../jis" Bibliography.get(code, date, opts) end |
#grammar_hash ⇒ Object
38 39 40 41 |
# File 'lib/relaton/jis/processor.rb', line 38 def grammar_hash require_relative "../jis" Digest::MD5.hexdigest Relaton::Jis::VERSION + Relaton::Bib::VERSION end |
#remove_index_file ⇒ Object
47 48 49 50 51 52 |
# File 'lib/relaton/jis/processor.rb', line 47 def remove_index_file require_relative "../jis" Relaton::Index.find_or_create( :jis, url: true, file: "#{INDEXFILE}.yaml" ).remove_file end |
#threads ⇒ Object
43 44 45 |
# File 'lib/relaton/jis/processor.rb', line 43 def threads 3 end |