Class: Epuber::Compiler::FileTypes::NavFile
- Inherits:
-
GeneratedFile
- Object
- AbstractFile
- GeneratedFile
- Epuber::Compiler::FileTypes::NavFile
- Defined in:
- lib/epuber/compiler/file_types/nav_file.rb
Instance Attribute Summary collapse
- #epub_version ⇒ Epuber::Version readonly
Attributes inherited from GeneratedFile
Attributes inherited from AbstractFile
#destination_path, #final_destination_path, #group, #path_type, #pkg_destination_path, #properties
Instance Method Summary collapse
-
#initialize(epub_version) ⇒ NavFile
constructor
A new instance of NavFile.
- #process(compilation_context) ⇒ Object
Methods inherited from GeneratedFile
Methods inherited from AbstractFile
#==, file_copy, file_copy!, file_copy?, write_to_file, write_to_file!, write_to_file?
Constructor Details
#initialize(epub_version) ⇒ NavFile
Returns a new instance of NavFile.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/epuber/compiler/file_types/nav_file.rb', line 17 def initialize(epub_version) super() @epub_version = epub_version properties << :navigation self.destination_path = if epub_version >= 3 'nav.xhtml' else 'nav.ncx' end self.path_type = :manifest end |
Instance Attribute Details
#epub_version ⇒ Epuber::Version (readonly)
13 14 15 |
# File 'lib/epuber/compiler/file_types/nav_file.rb', line 13 def epub_version @epub_version end |
Instance Method Details
#process(compilation_context) ⇒ Object
35 36 37 38 |
# File 'lib/epuber/compiler/file_types/nav_file.rb', line 35 def process(compilation_context) gen = NavGenerator.new(compilation_context) write_generate(gen.generate_nav.to_s) end |