Sha256: 665418dae79b720fb0a11e0fe9530901d4318b30efe8a0935697fdf4609ab674
Contents?: true
Size: 657 Bytes
Versions: 4
Compression:
Stored size: 657 Bytes
Contents
module GutenbergRdf class Rdf class Media attr_reader :xml def initialize(xml) @xml = xml end def uri xml.attributes['about'] end def media_type datatype[:type] end def encoding datatype[:encoding] end def modified DateTime.parse(xml.elements['dcterms:modified'].text + '-07:00') end private def datatype parts = xml.elements['dcterms:format/rdf:Description/rdf:value'].text.split(/; */) t = parts.shift e = parts.join(';').sub('charset=', '') {type: t, encoding: e} end end end end
Version data entries
4 entries across 4 versions & 1 rubygems