Sha256: f3617a6b880e88bed40dca4c8a924140808bcf06d200c22f600431408b868dad
Contents?: true
Size: 1003 Bytes
Versions: 20
Compression:
Stored size: 1003 Bytes
Contents
require 'ks' module FormatParser class Archive include FormatParser::AttributesJSON class Entry < Ks.strict(:type, :size, :filename) def to_json(*a) to_h.to_json(*a) end end # Lots of Office and LibreOffice documents are in fact packaged into # ZIPs, as are .epub files. We make `nature` customisable for this occasion attr_accessor :nature # What filetype was recognized? Will contain a non-ambiguous symbol # referring to the file format. The symbol can be used as a filename # extension safely attr_accessor :format # Array of Entry structs attr_accessor :entries # If a parser wants to provide any extra information to the caller # it can be placed here attr_accessor :intrinsics # The MIME type of the archive attr_accessor :content_type # Only permits assignments via defined accessors def initialize(**attributes) attributes.map { |(k, v)| public_send("#{k}=", v) } end end end
Version data entries
20 entries across 20 versions & 1 rubygems