Class: Relaton::Ccsds::Processor
- Inherits:
-
Relaton::Core::Processor
- Object
- Relaton::Core::Processor
- Relaton::Ccsds::Processor
- Defined in:
- lib/relaton/ccsds/processor.rb
Instance Attribute Summary collapse
-
#idtype ⇒ Object
readonly
Returns the value of attribute idtype.
Instance Method Summary collapse
-
#fetch_data(source = "ccsds", **opts) ⇒ Object
Fetch all the documents from a source.
- #from_xml(xml) ⇒ Relaton::Ccsds::ItemData
- #from_yaml(yaml) ⇒ Relaton::Ccsds::ItemData
- #get(code, date, opts) ⇒ Relaton::Ccsds::ItemData?
-
#grammar_hash ⇒ String
Returns hash of XML grammar.
-
#initialize ⇒ Processor
constructor
rubocop:disable Lint/MissingSuper.
-
#remove_index_file ⇒ Object
Remove index file.
Constructor Details
#initialize ⇒ Processor
rubocop:disable Lint/MissingSuper
8 9 10 11 12 13 14 |
# File 'lib/relaton/ccsds/processor.rb', line 8 def initialize # rubocop:disable Lint/MissingSuper @short = :relaton_ccsds @prefix = "CCSDS" @defaultprefix = %r{^CCSDS(?!\w)} @idtype = "CCSDS" @datasets = %w[ccsds] end |
Instance Attribute Details
#idtype ⇒ Object (readonly)
Returns the value of attribute idtype.
6 7 8 |
# File 'lib/relaton/ccsds/processor.rb', line 6 def idtype @idtype end |
Instance Method Details
#fetch_data(source = "ccsds", **opts) ⇒ Object
Fetch all the documents from a source
33 34 35 36 |
# File 'lib/relaton/ccsds/processor.rb', line 33 def fetch_data(source = "ccsds", **opts) require_relative "data/fetcher" DataFetcher.fetch(source, **opts) end |
#from_xml(xml) ⇒ Relaton::Ccsds::ItemData
40 41 42 43 |
# File 'lib/relaton/ccsds/processor.rb', line 40 def from_xml(xml) require_relative "../ccsds" Item.from_xml xml end |
#from_yaml(yaml) ⇒ Relaton::Ccsds::ItemData
47 48 49 50 |
# File 'lib/relaton/ccsds/processor.rb', line 47 def from_yaml(yaml) require_relative "../ccsds" Item.from_yaml yaml end |
#get(code, date, opts) ⇒ Relaton::Ccsds::ItemData?
20 21 22 23 |
# File 'lib/relaton/ccsds/processor.rb', line 20 def get(code, date, opts) require_relative "../ccsds" Bibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
54 55 56 57 |
# File 'lib/relaton/ccsds/processor.rb', line 54 def grammar_hash require_relative "../ccsds" @grammar_hash ||= ::Relaton::Ccsds.grammar_hash end |