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