Module: EPUB::Book::Features
- Included in:
- EPUB::Book
- Defined in:
- lib/epub/book/features.rb
Instance Attribute Summary collapse
-
#epub_file ⇒ Object
Returns the value of attribute epub_file.
Instance Method Summary collapse
- #container_adapter ⇒ Object
- #container_adapter=(adapter) ⇒ Object
-
#cover_image ⇒ Object
Syntax sugar.
- #each_content(&blk) ⇒ Object
- #each_page_on_spine(&blk) ⇒ Object
- #each_page_on_toc(&blk) ⇒ Object
- #other_navigation ⇒ Object
- #release_identifier ⇒ Object
-
#resources ⇒ Array<Publication::Package::Manifest::Item>
All Publication::Package::Manifest::Items in EPUB package.
-
#rootfile_path ⇒ Object
Syntax sugar.
Instance Attribute Details
#epub_file ⇒ Object
Returns the value of attribute epub_file.
6 7 8 |
# File 'lib/epub/book/features.rb', line 6 def epub_file @epub_file end |
Instance Method Details
#container_adapter ⇒ Object
36 37 38 |
# File 'lib/epub/book/features.rb', line 36 def container_adapter @adapter || OCF::PhysicalContainer.adapter end |
#container_adapter=(adapter) ⇒ Object
40 41 42 43 |
# File 'lib/epub/book/features.rb', line 40 def container_adapter=(adapter) @adapter = adapter.instance_of?(Class) ? adapter : OCF::PhysicalContainer.const_get(adapter) adapter end |
#cover_image ⇒ Object
Syntax sugar
92 93 94 |
# File 'lib/epub/book/features.rb', line 92 def cover_image manifest.cover_image end |
#each_content {|item| ... } ⇒ Object #each_content ⇒ Enumerator
68 69 70 71 72 73 74 75 |
# File 'lib/epub/book/features.rb', line 68 def each_content(&blk) enum = manifest.items if block_given? enum.each &blk else enum.to_enum end end |
#each_page_on_spine {|item| ... } ⇒ Object #each_page_on_spine ⇒ Enumerator
50 51 52 53 54 55 56 57 |
# File 'lib/epub/book/features.rb', line 50 def each_page_on_spine(&blk) enum = package.spine.items if block_given? enum.each &blk else enum.each end end |
#each_page_on_toc(&blk) ⇒ Object
59 60 61 |
# File 'lib/epub/book/features.rb', line 59 def each_page_on_toc(&blk) raise NotImplementedError end |
#other_navigation ⇒ Object
77 78 79 |
# File 'lib/epub/book/features.rb', line 77 def raise NotImplementedError end |
#release_identifier ⇒ Object
32 33 34 |
# File 'lib/epub/book/features.rb', line 32 def release_identifier "#{unique_identifier}@#{modified}" end |
#resources ⇒ Array<Publication::Package::Manifest::Item>
Returns All Publication::Package::Manifest::Items in EPUB package.
82 83 84 |
# File 'lib/epub/book/features.rb', line 82 def resources manifest.items end |
#rootfile_path ⇒ Object
Syntax sugar
87 88 89 |
# File 'lib/epub/book/features.rb', line 87 def rootfile_path ocf.container.rootfile.full_path.to_s end |