Module: EPUB::Book::Features

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


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

def epub_file
  @epub_file
end

Instance Method Details

#container_adapterObject


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_imageObject

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_contentEnumerator

Overloads:


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_spineEnumerator

Overloads:


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

Raises:

  • (NotImplementedError)

59
60
61
# File 'lib/epub/book/features.rb', line 59

def each_page_on_toc(&blk)
  raise NotImplementedError
end

#other_navigationObject

Raises:

  • (NotImplementedError)

77
78
79
# File 'lib/epub/book/features.rb', line 77

def other_navigation
  raise NotImplementedError
end

#release_identifierObject


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

def release_identifier
  "#{unique_identifier}@#{modified}"
end

#resourcesArray<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_pathObject

Syntax sugar


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

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