Class: EPUB::OCF::PhysicalContainer
- Inherits:
-
Object
- Object
- EPUB::OCF::PhysicalContainer
show all
- Defined in:
- lib/epub/ocf/physical_container.rb,
lib/epub/ocf/physical_container/zipruby.rb,
lib/epub/ocf/physical_container/archive_zip.rb,
lib/epub/ocf/physical_container/unpacked_uri.rb,
lib/epub/ocf/physical_container/unpacked_directory.rb
Overview
Defined Under Namespace
Classes: ArchiveZip, UnpackedDirectory, UnpackedURI, Zipruby
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of PhysicalContainer.
42
43
44
|
# File 'lib/epub/ocf/physical_container.rb', line 42
def initialize(container_path)
@container_path = container_path
end
|
Class Method Details
.adapter ⇒ Object
12
13
14
15
|
# File 'lib/epub/ocf/physical_container.rb', line 12
def adapter
raise NoMethodError, "undefined method `#{__method__}' for #{self}" unless self == PhysicalContainer
@adapter
end
|
.adapter=(adapter) ⇒ Object
17
18
19
20
21
|
# File 'lib/epub/ocf/physical_container.rb', line 17
def adapter=(adapter)
raise NoMethodError, "undefined method `#{__method__}' for #{self}" unless self == PhysicalContainer
@adapter = adapter.instance_of?(Class) ? adapter : const_get(adapter)
adapter
end
|
.open(container_path) ⇒ Object
23
24
25
26
27
|
# File 'lib/epub/ocf/physical_container.rb', line 23
def open(container_path)
_adapter.new(container_path).open do |container|
yield container
end
end
|
.read(container_path, path_name) ⇒ Object
29
30
31
32
33
|
# File 'lib/epub/ocf/physical_container.rb', line 29
def read(container_path, path_name)
open(container_path) {|container|
container.read(path_name)
}
end
|