Class: EPUBMeta::Parser
- Inherits:
-
Object
- Object
- EPUBMeta::Parser
- Defined in:
- lib/epubmeta/parser.rb
Instance Attribute Summary collapse
-
#metadata_document ⇒ Object
Returns the value of attribute metadata_document.
-
#path ⇒ Object
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
- #drm_protected? ⇒ Boolean
- #get_full_path(container_root_doc) ⇒ Object
- #metadata_path ⇒ Object
- #zip_file ⇒ Object
Instance Attribute Details
#metadata_document ⇒ Object
Returns the value of attribute metadata_document.
3 4 5 |
# File 'lib/epubmeta/parser.rb', line 3 def @metadata_document end |
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/epubmeta/parser.rb', line 3 def path @path end |
Class Method Details
Instance Method Details
#drm_protected? ⇒ Boolean
15 16 17 |
# File 'lib/epubmeta/parser.rb', line 15 def drm_protected? @drm_protected ||= !!zip_file.find_entry('META-INF/rights.xml') end |
#get_full_path(container_root_doc) ⇒ Object
31 32 33 34 |
# File 'lib/epubmeta/parser.rb', line 31 def get_full_path(container_root_doc) container_root_doc.remove_namespaces! container_root_doc.css('container rootfiles rootfile:first-child').attribute('full-path').content end |
#metadata_path ⇒ Object
27 28 29 |
# File 'lib/epubmeta/parser.rb', line 27 def @metadata_path ||= get_full_path(root_document) end |
#zip_file ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/epubmeta/parser.rb', line 19 def zip_file begin @zip_file ||= Zip::File.open(@path) rescue Zip::Error => e raise NotAnEPUBFileError.new(e) end end |