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


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

def container_adapter
  @adapter || OCF::PhysicalContainer.adapter
end

#container_adapter=(adapter) ⇒ Object


36
37
38
39
# File 'lib/epub/book/features.rb', line 36

def container_adapter=(adapter)
  @adapter = adapter.instance_of?(Class) ? adapter : OCF::PhysicalContainer.const_get(adapter)
  adapter
end

#cover_imageObject

Syntax sugar


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

def cover_image
  manifest.cover_image
end

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

Overloads:


64
65
66
67
68
69
70
71
# File 'lib/epub/book/features.rb', line 64

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:


46
47
48
49
50
51
52
53
# File 'lib/epub/book/features.rb', line 46

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)

55
56
57
# File 'lib/epub/book/features.rb', line 55

def each_page_on_toc(&blk)
  raise NotImplementedError
end

#other_navigationObject

Raises:

  • (NotImplementedError)

73
74
75
# File 'lib/epub/book/features.rb', line 73

def other_navigation
  raise NotImplementedError
end

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

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


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

def resources
  manifest.items
end

#rootfile_pathObject

Syntax sugar


83
84
85
# File 'lib/epub/book/features.rb', line 83

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