Class: EpubWorm::ManifestItem
- Inherits:
-
Object
- Object
- EpubWorm::ManifestItem
- Defined in:
- lib/epub_worm/manifest_item.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#media_type ⇒ Object
Returns the value of attribute media_type.
-
#reference ⇒ Object
Returns the value of attribute reference.
Instance Method Summary collapse
- #file ⇒ Object
-
#initialize(id: nil, reference: nil, media_type: nil, path: nil) ⇒ ManifestItem
constructor
A new instance of ManifestItem.
- #to_h ⇒ Object
Constructor Details
#initialize(id: nil, reference: nil, media_type: nil, path: nil) ⇒ ManifestItem
7 8 9 10 11 12 |
# File 'lib/epub_worm/manifest_item.rb', line 7 def initialize(id: nil, reference: nil, media_type: nil, path: nil) @id = id @reference = reference @media_type = media_type @path = path end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/epub_worm/manifest_item.rb', line 5 def id @id end |
#media_type ⇒ Object
Returns the value of attribute media_type.
5 6 7 |
# File 'lib/epub_worm/manifest_item.rb', line 5 def media_type @media_type end |
#reference ⇒ Object
Returns the value of attribute reference.
5 6 7 |
# File 'lib/epub_worm/manifest_item.rb', line 5 def reference @reference end |
Instance Method Details
#file ⇒ Object
14 15 16 |
# File 'lib/epub_worm/manifest_item.rb', line 14 def file ::EpubWorm::Extractors::File.extract(path, reference) end |
#to_h ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/epub_worm/manifest_item.rb', line 18 def to_h { id: id, reference: reference, media_type: media_type } end |