Class: FormatParser::Archive
- Inherits:
-
Object
- Object
- FormatParser::Archive
- Includes:
- AttributesJSON
- Defined in:
- lib/archive.rb
Defined Under Namespace
Classes: Entry
Instance Attribute Summary collapse
-
#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
Constructor Details
#initialize(**attributes) ⇒ Archive
Only permits assignments via defined accessors
30 31 32 |
# File 'lib/archive.rb', line 30 def initialize(**attributes) attributes.map { |(k, v)| public_send("#{k}=", v) } end |
Instance Attribute Details
#entries ⇒ Object
Array of Entry structs
23 24 25 |
# File 'lib/archive.rb', line 23 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
20 21 22 |
# File 'lib/archive.rb', line 20 def format @format end |
#intrinsics ⇒ Object
If a parser wants to provide any extra information to the caller it can be placed here
27 28 29 |
# File 'lib/archive.rb', line 27 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
15 16 17 |
# File 'lib/archive.rb', line 15 def nature @nature end |