Sha256: 05500d6f2bd14896f6a7881238aad268d158867e93cd046f80f97467a8d86b3c
Contents?: true
Size: 1.19 KB
Versions: 60
Compression:
Stored size: 1.19 KB
Contents
module RelatonBib # Version class BibliographicItem class Version include RelatonBib # @return [String, nil] attr_reader :revision_date, :draft # @param revision_date [String, nil] # @param draft [String, nil] def initialize(revision_date = nil, draft = nil) @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 builder.draft draft if draft end end # @return [Hash] def to_hash hash = {} hash["revision_date"] = revision_date if revision_date hash["draft"] = draft if draft hash end # @param prefix [String] # @return [String] def to_asciibib(prefix = "", count = 1) pref = prefix.empty? ? prefix : "#{prefix}." out = count > 1 ? "#{prefix}version::\n" : "" if revision_date out += "#{pref}version.revision_date:: #{revision_date}\n" end out += "#{pref}version.draft:: #{draft}\n" if draft out end end end end
Version data entries
60 entries across 60 versions & 1 rubygems