lib/epub/publication/package.rb in epub-parser-0.3.3 vs lib/epub/publication/package.rb in epub-parser-0.3.4
- old
+ new
@@ -41,9 +41,21 @@
def unique_identifier
@metadata.unique_identifier
end
+ # Corresponding {Rootfile}
+ # @return [OCF::Container::Rootfile]
+ def rootfile
+ @book.ocf.container.rootfiles.find {|rf| rf.package == self}
+ end
+
+ # Full path in EPUB archive
+ # @return [Addressable::URI]
+ def full_path
+ rootfile.full_path if rootfile
+ end
+
def inspect
"#<%{class}:%{object_id} %{attributes} %{models}>" % {
:class => self.class,
:object_id => inspect_object_id,
:attributes => inspect_instance_variables(exclude: CONTENT_MODELS.map {|model| :"@#{model}"}),