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
#compilation_context, #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!, write_to_file, write_to_file!, write_to_file?
Constructor Details
#initialize(epub_version) ⇒ NavFile
Returns a new instance of NavFile.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/epuber/compiler/file_types/nav_file.rb', line 15 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)
11 12 13 |
# File 'lib/epuber/compiler/file_types/nav_file.rb', line 11 def epub_version @epub_version end |
Instance Method Details
#process(compilation_context) ⇒ Object
33 34 35 36 |
# File 'lib/epuber/compiler/file_types/nav_file.rb', line 33 def process(compilation_context) gen = NavGenerator.new(compilation_context) write_generate(gen.generate_nav.to_s) end |