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 ⇒ Object
Forwarded to
manifest
. -
#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
41 42 43 |
# File 'lib/epub/book/features.rb', line 41 def container_adapter @adapter || OCF::PhysicalContainer.adapter end |
#container_adapter=(adapter) ⇒ Object
45 46 47 |
# File 'lib/epub/book/features.rb', line 45 def container_adapter=(adapter) @adapter = OCF::PhysicalContainer.find_adapter(adapter) end |
#cover_image ⇒ Object
Forwarded to manifest
#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
72 73 74 75 76 77 78 79 |
# File 'lib/epub/book/features.rb', line 72 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
54 55 56 57 58 59 60 61 |
# File 'lib/epub/book/features.rb', line 54 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
63 64 65 |
# File 'lib/epub/book/features.rb', line 63 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
81 82 83 |
# File 'lib/epub/book/features.rb', line 81 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.
86 87 88 |
# File 'lib/epub/book/features.rb', line 86 def resources manifest.items end |
#rootfile_path ⇒ Object
Syntax sugar
92 93 94 |
# File 'lib/epub/book/features.rb', line 92 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