class RelatonW3c::Processor

Attributes

idtype[R]

Public Class Methods

new() click to toggle source
# File lib/relaton_w3c/processor.rb, line 7
def initialize
  @short = :relaton_w3c
  @prefix = "W3C"
  @defaultprefix = %r{^W3C\s}
  @idtype = "W3C"
end

Public Instance Methods

from_xml(xml) click to toggle source

@param xml [String] @return [RelatonCalconnect::CcBibliographicItem]

# File lib/relaton_w3c/processor.rb, line 24
def from_xml(xml)
  ::RelatonW3c::XMLParser.from_xml xml
end
get(code, date, opts) click to toggle source

@param code [String] @param date [String, NilClass] year @param opts [Hash] @return [RelatonW3C::W3cBibliographicItem]

# File lib/relaton_w3c/processor.rb, line 18
def get(code, date, opts)
  ::RelatonW3c::W3cBibliography.get(code, date, opts)
end
grammar_hash() click to toggle source

Returns hash of XML grammar @return [String]

# File lib/relaton_w3c/processor.rb, line 37
def grammar_hash
  @grammar_hash ||= ::RelatonW3c.grammar_hash
end
hash_to_bib(hash) click to toggle source

@param hash [Hash] @return [RelatonIsoBib::CcBibliographicItem]

# File lib/relaton_w3c/processor.rb, line 30
def hash_to_bib(hash)
  item_hash = ::RelatonW3c::HashConverter.hash_to_bib(hash)
  ::RelatonW3c::W3cBibliographicItem.new(**item_hash)
end