Class: EPUB::OCF::PhysicalContainer::UnpackedURI
- Inherits:
-
EPUB::OCF::PhysicalContainer
- Object
- EPUB::OCF::PhysicalContainer
- EPUB::OCF::PhysicalContainer::UnpackedURI
- Defined in:
- lib/epub/ocf/physical_container/unpacked_uri.rb
Instance Method Summary collapse
-
#initialize(container_path) ⇒ UnpackedURI
constructor
EPUB URI: example.net/path/to/book/ container.xml: example.net/path/to/book/META-INF/container.xml.
- #open {|_self| ... } ⇒ Object
- #read(path_name) ⇒ Object
Methods inherited from EPUB::OCF::PhysicalContainer
adapter, adapter=, find_adapter, open, read
Constructor Details
#initialize(container_path) ⇒ UnpackedURI
EPUB URI: example.net/path/to/book/ container.xml: example.net/path/to/book/META-INF/container.xml
12 13 14 |
# File 'lib/epub/ocf/physical_container/unpacked_uri.rb', line 12 def initialize(container_path) super(URI(container_path)) end |
Instance Method Details
#open {|_self| ... } ⇒ Object
16 17 18 |
# File 'lib/epub/ocf/physical_container/unpacked_uri.rb', line 16 def open yield self end |
#read(path_name) ⇒ Object
20 21 22 23 24 |
# File 'lib/epub/ocf/physical_container/unpacked_uri.rb', line 20 def read(path_name) (@container_path + path_name).read rescue ::OpenURI::HTTPError => error raise NoEntry.from_error(error) end |