Class: FormatParser::Archive
- Inherits:
-
Object
- Object
- FormatParser::Archive
- Includes:
- AttributesJSON
- Defined in:
- lib/archive.rb
Defined Under Namespace
Classes: Entry
Constant Summary
Constants included from AttributesJSON
FormatParser::AttributesJSON::MAXIMUM_JSON_NESTING_WHEN_SANITIZING
Instance Attribute Summary collapse
-
#content_type ⇒ Object
The MIME type of the archive.
-
#entries ⇒ Object
Array of Entry structs.
-
#format ⇒ Object
What filetype was recognized? Will contain a non-ambiguous symbol referring to the file format.
-
#intrinsics ⇒ Object
If a parser wants to provide any extra information to the caller it can be placed here.
-
#nature ⇒ Object
Lots of Office and LibreOffice documents are in fact packaged into ZIPs, as are .epub files.
Instance Method Summary collapse
-
#initialize(**attributes) ⇒ Archive
constructor
Only permits assignments via defined accessors.
Methods included from AttributesJSON
_sanitize_json_value, #as_json, #to_json
Constructor Details
#initialize(**attributes) ⇒ Archive
Only permits assignments via defined accessors
31 32 33 |
# File 'lib/archive.rb', line 31 def initialize(**attributes) attributes.map { |(k, v)| public_send("#{k}=", v) } end |
Instance Attribute Details
#content_type ⇒ Object
The MIME type of the archive
28 29 30 |
# File 'lib/archive.rb', line 28 def content_type @content_type end |
#entries ⇒ Object
Array of Entry structs
21 22 23 |
# File 'lib/archive.rb', line 21 def entries @entries end |
#format ⇒ Object
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
18 19 20 |
# File 'lib/archive.rb', line 18 def format @format end |
#intrinsics ⇒ Object
If a parser wants to provide any extra information to the caller it can be placed here
25 26 27 |
# File 'lib/archive.rb', line 25 def intrinsics @intrinsics end |
#nature ⇒ Object
Lots of Office and LibreOffice documents are in fact packaged into ZIPs, as are .epub files. We make ‘nature` customisable for this occasion
13 14 15 |
# File 'lib/archive.rb', line 13 def nature @nature end |