class RelatonOmg::OmgBibliographicItem

Public Class Methods

from_hash(hash) click to toggle source

@param hash [Hash] @return [RelatonOmg::OmgBibliographicItem]

# File lib/relaton_omg/omg_bibliographic_item.rb, line 13
def from_hash(hash)
  bib_hash = RelatonOmg::HashConverter.hash_to_bib(hash)
  new **bib_hash
end
from_xml(file) click to toggle source

@param file [String] path to XML file @return [RelatonOmg::OmgBibliographicItem]

# File lib/relaton_omg/omg_bibliographic_item.rb, line 20
def from_xml(file)
  XMLParser.from_xml File.read file, encoding: "UTF-8"
end
from_yaml(file) click to toggle source

@param file [String] path to YAML file @return [RelatonOmg::OmgBibliographicItem]

# File lib/relaton_omg/omg_bibliographic_item.rb, line 7
def from_yaml(file)
  from_hash YAML.load_file(file)
end

Public Instance Methods

to_xml(**opts) click to toggle source

@param opts [Hash] @option opts [Nokogiri::XML::Builder] :builder XML builder @option opts [Boolean] :bibdata @option opts [String] :lang language @return [String] XML

Calls superclass method
# File lib/relaton_omg/omg_bibliographic_item.rb, line 30
def to_xml(**opts)
  opts[:date_format] ||= :short
  super
end