Class: RelatonGb::Processor
- Inherits:
-
Relaton::Processor
- Object
- Relaton::Processor
- RelatonGb::Processor
- Defined in:
- lib/relaton_gb/processor.rb
Instance Method Summary collapse
- #from_xml(xml) ⇒ RelatonGb::GbBibliographicItem
- #get(code, date, opts) ⇒ RelatonGb::GbBibliographicItem
-
#grammar_hash ⇒ String
Returns hash of XML grammar.
- #hash_to_bib(hash) ⇒ RelatonGb::GbBibliographicItem
-
#initialize ⇒ Processor
constructor
A new instance of Processor.
Constructor Details
#initialize ⇒ Processor
Returns a new instance of Processor.
7 8 9 10 11 12 |
# File 'lib/relaton_gb/processor.rb', line 7 def initialize @short = :relaton_gb @prefix = "CN" @defaultprefix = %r{^(GB|GB/T|GB/Z) } @idtype = "Chinese Standard" end |
Instance Method Details
#from_xml(xml) ⇒ RelatonGb::GbBibliographicItem
24 25 26 |
# File 'lib/relaton_gb/processor.rb', line 24 def from_xml(xml) ::RelatonGb::XMLParser.from_xml xml end |
#get(code, date, opts) ⇒ RelatonGb::GbBibliographicItem
18 19 20 |
# File 'lib/relaton_gb/processor.rb', line 18 def get(code, date, opts) ::RelatonGb::GbBibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
36 37 38 |
# File 'lib/relaton_gb/processor.rb', line 36 def grammar_hash @grammar_hash ||= ::RelatonGb.grammar_hash end |
#hash_to_bib(hash) ⇒ RelatonGb::GbBibliographicItem
30 31 32 |
# File 'lib/relaton_gb/processor.rb', line 30 def hash_to_bib(hash) ::RelatonGb::GbBibliographicItem.new hash end |