Class: EpubWorm::Reader
- Inherits:
-
Object
- Object
- EpubWorm::Reader
- Defined in:
- lib/epub_worm/reader.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #content(reference) ⇒ Object
- #cover ⇒ Object
- #cover_reference ⇒ Object
-
#initialize(path:) ⇒ Reader
constructor
A new instance of Reader.
- #manifest ⇒ Object
- #metadata ⇒ Object
- #navigation ⇒ Object
- #spine ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(path:) ⇒ Reader
Returns a new instance of Reader.
7 8 9 |
# File 'lib/epub_worm/reader.rb', line 7 def initialize(path:) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/epub_worm/reader.rb', line 5 def path @path end |
Instance Method Details
#content(reference) ⇒ Object
11 12 13 |
# File 'lib/epub_worm/reader.rb', line 11 def content(reference) ::EpubWorm::Extractors::Content.extract(path, reference) end |
#cover ⇒ Object
15 16 17 |
# File 'lib/epub_worm/reader.rb', line 15 def cover manifest.find { |manifest_item| manifest_item.reference == cover_reference } end |
#cover_reference ⇒ Object
19 20 21 |
# File 'lib/epub_worm/reader.rb', line 19 def cover_reference @cover_reference ||= ::EpubWorm::Extractors::CoverReference.extract(path) end |
#manifest ⇒ Object
23 24 25 |
# File 'lib/epub_worm/reader.rb', line 23 def manifest @manifest ||= ::EpubWorm::Extractors::Manifest.extract(path) end |
#metadata ⇒ Object
27 28 29 |
# File 'lib/epub_worm/reader.rb', line 27 def ||= ::EpubWorm::Extractors::Metadata.extract(path) end |
#navigation ⇒ Object
31 32 33 |
# File 'lib/epub_worm/reader.rb', line 31 def ||= ::EpubWorm::Extractors::.extract(path, version: version) end |
#spine ⇒ Object
35 36 37 |
# File 'lib/epub_worm/reader.rb', line 35 def spine @spine ||= ::EpubWorm::Extractors::Spine.extract(path) end |
#version ⇒ Object
39 40 41 |
# File 'lib/epub_worm/reader.rb', line 39 def version @version ||= ::EpubWorm::Extractors::Version.extract(path) end |