module EPUB::Book::Features

Attributes

epub_file[RW]

Public Instance Methods

cover_image() click to toggle source

Syntax sugar

# File lib/epub/book/features.rb, line 79
def cover_image
  manifest.cover_image
end
each_content(&blk) click to toggle source

@overload each_content(&blk)

iterate all items over when block given
@yieldparam item [Publication::Package::Manifest::Item]

@overload each_content

@return [Enumerator] which iterates over all {Publication::Package::Manifest::Item}s in EPUB package when block not given
# File lib/epub/book/features.rb, line 55
def each_content(&blk)
  enum = manifest.items
  if block_given?
    enum.each &blk
  else
    enum.to_enum
  end
end
each_page_on_spine(&blk) click to toggle source

@overload each_page_on_spine(&blk)

iterate over items in order of spine when block given
@yieldparam item [Publication::Package::Manifest::Item]

@overload each_page_on_spine

@return [Enumerator] which iterates over {Publication::Package::Manifest::Item}s in order of spine when block not given
# File lib/epub/book/features.rb, line 37
def each_page_on_spine(&blk)
  enum = package.spine.items
  if block_given?
    enum.each &blk
  else
    enum
  end
end
each_page_on_toc(&blk) click to toggle source
# File lib/epub/book/features.rb, line 46
def each_page_on_toc(&blk)
  raise NotImplementedError
end
other_navigation() click to toggle source
# File lib/epub/book/features.rb, line 64
def other_navigation
  raise NotImplementedError
end
resources() click to toggle source

@return [Array<Publication::Package::Manifest::Item>] All {Publication::Package::Manifest::Item}s in EPUB package

# File lib/epub/book/features.rb, line 69
def resources
  manifest.items
end
rootfile_path() click to toggle source

Syntax sugar

# File lib/epub/book/features.rb, line 74
def rootfile_path
  ocf.container.rootfile.full_path.to_s
end