Class: Relaton::Un::Processor
- Inherits:
-
Core::Processor
- Object
- Core::Processor
- Relaton::Un::Processor
- Defined in:
- lib/relaton/un/processor.rb
Instance Attribute Summary collapse
-
#idtype ⇒ Object
readonly
Returns the value of attribute idtype.
Instance Method Summary collapse
- #from_xml(xml) ⇒ Object
- #from_yaml(yaml) ⇒ Object
- #get(code, date, opts) ⇒ Object
- #grammar_hash ⇒ Object
-
#initialize ⇒ Processor
constructor
A new instance of Processor.
Constructor Details
#initialize ⇒ Processor
Returns a new instance of Processor.
10 11 12 13 14 15 |
# File 'lib/relaton/un/processor.rb', line 10 def initialize @short = :relaton_un @prefix = "UN" @defaultprefix = %r{^UN\s} @idtype = "UN" end |
Instance Attribute Details
#idtype ⇒ Object (readonly)
Returns the value of attribute idtype.
8 9 10 |
# File 'lib/relaton/un/processor.rb', line 8 def idtype @idtype end |
Instance Method Details
#from_xml(xml) ⇒ Object
22 23 24 25 |
# File 'lib/relaton/un/processor.rb', line 22 def from_xml(xml) require_relative "../un" Bibdata.from_xml(xml) end |
#from_yaml(yaml) ⇒ Object
27 28 29 30 |
# File 'lib/relaton/un/processor.rb', line 27 def from_yaml(yaml) require_relative "../un" Item.from_yaml(yaml) end |
#get(code, date, opts) ⇒ Object
17 18 19 20 |
# File 'lib/relaton/un/processor.rb', line 17 def get(code, date, opts) require_relative "../un" Bibliography.get(code, date, opts) end |
#grammar_hash ⇒ Object
32 33 34 35 |
# File 'lib/relaton/un/processor.rb', line 32 def grammar_hash require_relative "../un" @grammar_hash ||= Relaton::Un.grammar_hash end |