Class: EpubWorm::Extractors::Navigation

Inherits:
Object
  • Object
show all
Defined in:
lib/epub_worm/extractors/navigation.rb

Class Method Summary collapse

Class Method Details

.extract(path, version:) ⇒ Object



6
7
8
# File 'lib/epub_worm/extractors/navigation.rb', line 6

def self.extract(path, version:)
  extractor_for(version).extract(path)
end

.extractor_for(version) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/epub_worm/extractors/navigation.rb', line 10

def self.extractor_for(version)
  case version
  when 3
    ::EpubWorm::Extractors::XhtmlNavigation
  when 2
    ::EpubWorm::Extractors::NcxNavigation
  else
    raise ::EpubWorm::Error, "unsupported epub version: #{version.inspect}"
  end
end