Class: Prophecy::Manifest
- Inherits:
-
Object
- Object
- Prophecy::Manifest
- Defined in:
- lib/prophecy/manifest.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
Returns the value of attribute items.
Instance Method Summary collapse
- #find_by_filename(filename) ⇒ Object
-
#initialize(book) ⇒ Manifest
constructor
A new instance of Manifest.
Constructor Details
#initialize(book) ⇒ Manifest
8 9 10 11 12 13 14 15 16 |
# File 'lib/prophecy/manifest.rb', line 8 def initialize(book) @items = [] @dir = File.(File.join(book.build_dir, 'OEBPS')) Dir[File.join(@dir, '**/*')].each do |f| next if File.directory?(f) next if File.fnmatch('content.opf*', File.basename(f)) @items << ManifestItem.new(book, @dir, f) end end |
Instance Attribute Details
#items ⇒ Object
Returns the value of attribute items.
6 7 8 |
# File 'lib/prophecy/manifest.rb', line 6 def items @items end |
Instance Method Details
#find_by_filename(filename) ⇒ Object
18 19 20 |
# File 'lib/prophecy/manifest.rb', line 18 def find_by_filename(filename) @items.select{|i| File.basename(i.path) == File.basename(filename) }.first.href end |