Class: Relaton::Gb::Processor
- Inherits:
-
Core::Processor
- Object
- Core::Processor
- Relaton::Gb::Processor
- Defined in:
- lib/relaton/gb/processor.rb
Instance Method Summary collapse
- #from_xml(xml) ⇒ Relaton::Gb::ItemData
- #from_yaml(yaml) ⇒ Relaton::Gb::ItemData
- #get(code, date, opts) ⇒ Relaton::Gb::ItemData?
-
#grammar_hash ⇒ String
Returns hash of XML grammar.
-
#initialize ⇒ Processor
constructor
A new instance of Processor.
Constructor Details
#initialize ⇒ Processor
Returns a new instance of Processor.
8 9 10 11 12 13 |
# File 'lib/relaton/gb/processor.rb', line 8 def initialize @short = :relaton_gb @prefix = "CN" @defaultprefix = %r{^(GB|GB/T|GB/Z) } @idtype = "Chinese Standard" end |
Instance Method Details
#from_xml(xml) ⇒ Relaton::Gb::ItemData
26 27 28 29 |
# File 'lib/relaton/gb/processor.rb', line 26 def from_xml(xml) require_relative "../gb" Item.from_xml xml end |
#from_yaml(yaml) ⇒ Relaton::Gb::ItemData
33 34 35 |
# File 'lib/relaton/gb/processor.rb', line 33 def from_yaml(yaml) Item.from_yaml yaml end |
#get(code, date, opts) ⇒ Relaton::Gb::ItemData?
19 20 21 22 |
# File 'lib/relaton/gb/processor.rb', line 19 def get(code, date, opts) require_relative "../gb" Bibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
39 40 41 42 |
# File 'lib/relaton/gb/processor.rb', line 39 def grammar_hash require_relative "../gb" @grammar_hash ||= ::Relaton::Gb.grammar_hash end |