Sha256: 60fdc6a19fe0eaca0782927d9af4756e8d549e146d2cf99c5d4f4c1d2744b982
Contents?: true
Size: 918 Bytes
Versions: 29
Compression:
Stored size: 918 Bytes
Contents
module RelatonBib # Version class BibliographicItem class Version include RelatonBib # @return [String, NilClass] attr_reader :revision_date # @return [Array<String>] attr_reader :draft # @param revision_date [String, NilClass] # @param draft [Array<String>] def initialize(revision_date = nil, draft = []) @revision_date = revision_date @draft = draft end # @param builder [Nokogiri::XML::Builder] def to_xml(builder) builder.version do builder.send("revision-date", revision_date) if revision_date draft.each { |d| builder.draft d } end end # @return [Hash] def to_hash hash = {} hash["revision_date"] = revision_date if revision_date hash["draft"] = single_element_array(draft) if draft&.any? hash end end end end
Version data entries
29 entries across 29 versions & 2 rubygems