Sha256: a7d69c20f3a18f5b2e70c7bac83e922a1628b0b320cbfb75729ad2efd59613c6
Contents?: true
Size: 1.39 KB
Versions: 5
Compression:
Stored size: 1.39 KB
Contents
module RelatonBib # module DocumentRelationType # PARENT = 'parent' # CHILD = 'child' # OBSOLETES = 'obsoletes' # UPDATES = 'updates' # COMPLEMENTS = 'complements' # DERIVED_FORM = 'derivedForm' # ADOPTED_FORM = 'adoptedForm' # EQUIVALENT = 'equivalent' # IDENTICAL = 'identical' # NONEQUIVALENT = 'nonequivalent' # end # Documett relation class DocumentRelation # @return [String] attr_reader :type # @return [String] # attr_reader :identifier, :url # @return [RelatonBib::BibliographicItem] attr_reader :bibitem # @return [Array<RelatonBib::BibItemLocality>] attr_reader :bib_locality # @param type [String] # @param bibitem [RelatonBib::BibliographicItem, RelatonIso::IsoBibliographicItem] # @param bib_locality [Array<RelatonBib::BibItemLocality>] def initialize(type:, bibitem:, bib_locality: []) type = "obsoletes" if type == "Now withdrawn" @type = type @bib_locality = bib_locality @bibitem = bibitem end # @param builder [Nokogiri::XML::Builder] def to_xml(builder, **opts) opts.delete :bibdata opts.delete :note builder.relation(type: type) do bibitem.to_xml(builder, **opts.merge(embedded: true)) bib_locality.each do |l| l.to_xml builder end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems