Module: EPUB::Book::Features
Instance Attribute Summary collapse
-
#epub_file ⇒ Object
Returns the value of attribute epub_file.
-
#ocf ⇒ Object
Returns the value of attribute ocf.
Instance Method Summary collapse
-
#bindings ⇒ Object
Forwarded to
package
. -
#collection_title ⇒ Object
Forwarded to
metadata
. - #container_adapter ⇒ Object
- #container_adapter=(adapter) ⇒ Object
-
#cover_image ⇒ EPUB::Publication::Package::Manifest::Item
Cover image defined in EPUB 3 or used in EPUB 2.
-
#date ⇒ Object
Forwarded to
metadata
. -
#default_rendition ⇒ Package|nil
(also: #package)
First
package
inpackages
. -
#description ⇒ Object
Forwarded to
metadata
. - #each_content(&blk) ⇒ Object
- #each_page_on_spine(&blk) ⇒ Object
- #each_page_on_toc(&blk) ⇒ Object
-
#edition_title ⇒ Object
Forwarded to
metadata
. -
#extended_title ⇒ Object
Forwarded to
metadata
. -
#guide ⇒ Object
Forwarded to
package
. -
#main_title ⇒ Object
Forwarded to
metadata
. -
#manifest ⇒ Object
Forwarded to
package
. -
#metadata ⇒ Object
Forwarded to
package
. -
#modified ⇒ Object
Forwarded to
metadata
. -
#nav ⇒ Object
Forwarded to
manifest
. - #other_navigation ⇒ Object
-
#package_identifier ⇒ Object
Forwarded to
metadata
. - #packages ⇒ Array<Publication::Package> (also: #renditions)
-
#release_identifier ⇒ Object
Forwarded to
metadata
. -
#resources ⇒ Array<Publication::Package::Manifest::Item>
All Publication::Package::Manifest::Items in EPUB package.
-
#rootfile_path ⇒ Object
Syntax sugar.
- #rootfiles ⇒ Array<OCF::Container::Rootfile>
-
#short_title ⇒ Object
Forwarded to
metadata
. -
#spine ⇒ Object
Forwarded to
package
. -
#subtitle ⇒ Object
Forwarded to
metadata
. -
#title ⇒ Object
Forwarded to
metadata
. -
#unique_identifier ⇒ Object
Forwarded to
metadata
.
Instance Attribute Details
#epub_file ⇒ Object
Returns the value of attribute epub_file.
8 9 10 |
# File 'lib/epub/book/features.rb', line 8 def epub_file @epub_file end |
#ocf ⇒ Object
Returns the value of attribute ocf.
7 8 9 |
# File 'lib/epub/book/features.rb', line 7 def ocf @ocf end |
Instance Method Details
#bindings ⇒ Object
Forwarded to package
#collection_title ⇒ Object
Forwarded to metadata
#container_adapter ⇒ Object
[View source]
41 42 43 |
# File 'lib/epub/book/features.rb', line 41 def container_adapter @adapter || OCF::PhysicalContainer.adapter end |
#container_adapter=(adapter) ⇒ Object
[View source]
45 46 47 |
# File 'lib/epub/book/features.rb', line 45 def container_adapter=(adapter) @adapter = OCF::PhysicalContainer.find_adapter(adapter) end |
#cover_image ⇒ EPUB::Publication::Package::Manifest::Item
Cover image defined in EPUB 3 or used in EPUB 2
51 52 53 |
# File 'lib/epub/book/features.rb', line 51 def cover_image manifest.cover_image || .cover_image end |
#date ⇒ Object
Forwarded to metadata
#default_rendition ⇒ Package|nil Also known as: package
First package
in packages
31 32 33 |
# File 'lib/epub/book/features.rb', line 31 def default_rendition packages.first end |
#description ⇒ Object
Forwarded to metadata
#each_content {|item| ... } ⇒ Object #each_content ⇒ Enumerator
78 79 80 81 82 83 84 85 |
# File 'lib/epub/book/features.rb', line 78 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
60 61 62 63 64 65 66 67 |
# File 'lib/epub/book/features.rb', line 60 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
69 70 71 |
# File 'lib/epub/book/features.rb', line 69 def each_page_on_toc(&blk) raise NotImplementedError end |
#edition_title ⇒ Object
Forwarded to metadata
#extended_title ⇒ Object
Forwarded to metadata
#guide ⇒ Object
Forwarded to package
#main_title ⇒ Object
Forwarded to metadata
#manifest ⇒ Object
Forwarded to package
#metadata ⇒ Object
Forwarded to package
#modified ⇒ Object
Forwarded to metadata
#nav ⇒ Object
Forwarded to manifest
#other_navigation ⇒ Object
87 88 89 |
# File 'lib/epub/book/features.rb', line 87 def raise NotImplementedError end |
#package_identifier ⇒ Object
Forwarded to metadata
#packages ⇒ Array<Publication::Package> Also known as: renditions
24 25 26 |
# File 'lib/epub/book/features.rb', line 24 def packages rootfiles.map(&:package) end |
#release_identifier ⇒ Object
Forwarded to metadata
#resources ⇒ Array<Publication::Package::Manifest::Item>
Returns All Publication::Package::Manifest::Items in EPUB package.
92 93 94 |
# File 'lib/epub/book/features.rb', line 92 def resources manifest.items end |
#rootfile_path ⇒ Object
Syntax sugar
98 99 100 |
# File 'lib/epub/book/features.rb', line 98 def rootfile_path ocf.container.rootfile.full_path.to_s end |
#rootfiles ⇒ Array<OCF::Container::Rootfile>
19 20 21 |
# File 'lib/epub/book/features.rb', line 19 def rootfiles ocf.container.rootfiles end |
#short_title ⇒ Object
Forwarded to metadata
#spine ⇒ Object
Forwarded to package
#subtitle ⇒ Object
Forwarded to metadata
#title ⇒ Object
Forwarded to metadata
#unique_identifier ⇒ Object
Forwarded to metadata