Class: Relaton::Ecma::Processor
- Inherits:
-
Core::Processor
- Object
- Core::Processor
- Relaton::Ecma::Processor
- Defined in:
- lib/relaton/ecma/processor.rb
Instance Method Summary collapse
-
#fetch_data(source, opts) ⇒ Object
Fetch all the documents from a source.
- #from_xml(xml) ⇒ Relaton::Ecma::ItemData
- #from_yaml(yaml) ⇒ Relaton::Ecma::ItemData
- #get(code, date, opts) ⇒ Relaton::Ecma::ItemData?
-
#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.
6 7 8 9 10 11 12 |
# File 'lib/relaton/ecma/processor.rb', line 6 def initialize @short = :relaton_ecma @prefix = "ECMA" @defaultprefix = /^ECMA(-|\s)/ @idtype = "ECMA" @datasets = %w[ecma-standards] end |
Instance Method Details
#fetch_data(source, opts) ⇒ Object
Fetch all the documents from a source
31 32 33 34 |
# File 'lib/relaton/ecma/processor.rb', line 31 def fetch_data(source, opts) require_relative "data_fetcher" DataFetcher.fetch(source, **opts) end |
#from_xml(xml) ⇒ Relaton::Ecma::ItemData
38 39 40 41 |
# File 'lib/relaton/ecma/processor.rb', line 38 def from_xml(xml) require_relative "../ecma" Item.from_xml xml end |
#from_yaml(yaml) ⇒ Relaton::Ecma::ItemData
45 46 47 |
# File 'lib/relaton/ecma/processor.rb', line 45 def from_yaml(yaml) Item.from_yaml yaml end |
#get(code, date, opts) ⇒ Relaton::Ecma::ItemData?
18 19 20 21 |
# File 'lib/relaton/ecma/processor.rb', line 18 def get(code, date, opts) require_relative "../ecma" Bibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
51 52 53 54 |
# File 'lib/relaton/ecma/processor.rb', line 51 def grammar_hash require_relative "../ecma" @grammar_hash ||= Ecma.grammar_hash end |