Sha256: f5a34e8fbc2afc59f2c7bfecb44385940f8ca12c09e5a89cf1ebd7572407e8e5
Contents?: true
Size: 902 Bytes
Versions: 33
Compression:
Stored size: 902 Bytes
Contents
module RelatonBib class BiblioNote < FormattedString # @return [String, NilClass] attr_reader :type # @param content [String] # @param type [String, NilClass] # @param language [String, NilClass] language code Iso639 # @param script [String, NilClass] script code Iso15924 # @param format [String, NilClass] the content format def initialize(content:, type: nil, language: nil, script: nil, format: nil) @type = type super content: content, language: language, script: script, format: format end # @param builder [Nokogiri::XML::Builder] def to_xml(builder) xml = builder.note { super } xml[:type] = type if type xml end # @return [Hash] def to_hash hash = super return hash unless type hash = { "content" => hash } if hash.is_a? String hash["type"] = type hash end end end
Version data entries
33 entries across 33 versions & 2 rubygems