Module: EPUB::Book::Features

Extended by:
Forwardable
Included in:
EPUB::Book
Defined in:
lib/epub/book/features.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#epub_fileObject

Returns the value of attribute epub_file.


8
9
10
# File 'lib/epub/book/features.rb', line 8

def epub_file
  @epub_file
end

#ocfObject

Returns the value of attribute ocf.


7
8
9
# File 'lib/epub/book/features.rb', line 7

def ocf
  @ocf
end

Instance Method Details

#bindingsObject

Forwarded to package

#collection_titleObject

Forwarded to metadata

#container_adapterObject

[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_imageEPUB::Publication::Package::Manifest::Item

Cover image defined in EPUB 3 or used in EPUB 2

[View source]

51
52
53
# File 'lib/epub/book/features.rb', line 51

def cover_image
  manifest.cover_image || .cover_image
end

#dateObject

Forwarded to metadata

#default_renditionPackage|nil Also known as: package

First package in packages

Returns:

  • (Package|nil)
[View source]

31
32
33
# File 'lib/epub/book/features.rb', line 31

def default_rendition
  packages.first
end

#descriptionObject

Forwarded to metadata

#each_content {|item| ... } ⇒ Object #each_contentEnumerator

Overloads:

[View source]

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_spineEnumerator

Overloads:

[View source]

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

Raises:

  • (NotImplementedError)
[View source]

69
70
71
# File 'lib/epub/book/features.rb', line 69

def each_page_on_toc(&blk)
  raise NotImplementedError
end

#edition_titleObject

Forwarded to metadata

#extended_titleObject

Forwarded to metadata

#guideObject

Forwarded to package

#main_titleObject

Forwarded to metadata

#manifestObject

Forwarded to package

#metadataObject

Forwarded to package

#modifiedObject

Forwarded to metadata

Forwarded to manifest

#other_navigationObject

Raises:

  • (NotImplementedError)
[View source]

87
88
89
# File 'lib/epub/book/features.rb', line 87

def other_navigation
  raise NotImplementedError
end

#package_identifierObject

Forwarded to metadata

#packagesArray<Publication::Package> Also known as: renditions

Returns:

[View source]

24
25
26
# File 'lib/epub/book/features.rb', line 24

def packages
  rootfiles.map(&:package)
end

#release_identifierObject

Forwarded to metadata

#resourcesArray<Publication::Package::Manifest::Item>

Returns All Publication::Package::Manifest::Items in EPUB package.

[View source]

92
93
94
# File 'lib/epub/book/features.rb', line 92

def resources
  manifest.items
end

#rootfile_pathObject

Syntax sugar

Returns:

  • String

[View source]

98
99
100
# File 'lib/epub/book/features.rb', line 98

def rootfile_path
  ocf.container.rootfile.full_path.to_s
end

#rootfilesArray<OCF::Container::Rootfile>

Returns:

[View source]

19
20
21
# File 'lib/epub/book/features.rb', line 19

def rootfiles
  ocf.container.rootfiles
end

#short_titleObject

Forwarded to metadata

#spineObject

Forwarded to package

#subtitleObject

Forwarded to metadata

#titleObject

Forwarded to metadata

#unique_identifierObject

Forwarded to metadata