Sha256: f2f42253281bdecb0337df765416cb6f607bd707e3e765a6eee5a7c694d07f6a
Contents?: true
Size: 1.24 KB
Versions: 16
Compression:
Stored size: 1.24 KB
Contents
module RelatonIeee class IeeeBibliographicItem < RelatonBib::BibliographicItem # @return [Array<RelatonIeee::Committee>] attr_reader :committee # @param committee [Array<RelatonIeee::Committee>] def initialize(**args) @committee = args.delete(:committee) || [] super end # @param hash [Hash] # @return [RelatonIeee::IeeeBibliographicItem] def self.from_hash(hash) item_hash = ::RelatonIeee::HashConverter.hash_to_bib(hash) new(**item_hash) end # @param opts [Hash] # @option opts [Nokogiri::XML::Builder] :builder XML builder # @option opts [Boolean] :bibdata # @option opts [String] :lang language # @return [String] XML def to_xml(**opts) super(**opts) do |bldr| if opts[:bibdata] && committee.any? bldr.ext do |b| committee.each { |c| c.to_xml b } end end end end # @return [Hash] def to_hash hash = super hash["committee"] = committee.map &:to_hash if committee.any? hash end # @param prefix [String] # @return [String] def to_asciibib(prefix = "") out = super committee.each { |c| out += c.to_asciibib prefix, committee.size } out end end end
Version data entries
16 entries across 16 versions & 1 rubygems