Sha256: efc9c3dd60ce9d791447d5bd9ec6e8c542f161b6365e674dc797fb018f2a6e4e
Contents?: true
Size: 935 Bytes
Versions: 50
Compression:
Stored size: 935 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 # Only permits assignments via defined accessors def initialize(**attributes) attributes.map { |(k, v)| public_send("#{k}=", v) } end end end
Version data entries
50 entries across 50 versions & 1 rubygems