Class: InVFS::Zip
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#zip ⇒ Object
readonly
Returns the value of attribute zip.
-
#zipfile ⇒ Object
readonly
Returns the value of attribute zipfile.
Instance Method Summary collapse
-
#file?(path) ⇒ Boolean
call-seq: file?(path) -> true OR false (OR nil).
-
#initialize(path) ⇒ Zip
constructor
A new instance of Zip.
- #inspect ⇒ Object
- #pretty_print(q) ⇒ Object
-
#read(path) ⇒ Object
call-seq: read(path) -> string.
-
#size(path) ⇒ Object
call-seq: size(path) -> integer for file size.
-
#to_path ⇒ Object
call-seq: to_path -> string.
-
#to_s ⇒ Object
optional method for VFS.
Constructor Details
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
11 12 13 |
# File 'lib/invfs/zip.rb', line 11 def path @path end |
#zip ⇒ Object (readonly)
Returns the value of attribute zip.
11 12 13 |
# File 'lib/invfs/zip.rb', line 11 def zip @zip end |
#zipfile ⇒ Object (readonly)
Returns the value of attribute zipfile.
11 12 13 |
# File 'lib/invfs/zip.rb', line 11 def zipfile @zipfile end |
Instance Method Details
#file?(path) ⇒ Boolean
call-seq:
file?(path) -> true OR false (OR nil)
REQUIRED method for VFS.
37 38 39 |
# File 'lib/invfs/zip.rb', line 37 def file?(path) zipfile.file?(path) end |
#inspect ⇒ Object
68 69 70 |
# File 'lib/invfs/zip.rb', line 68 def inspect %(#<#{self.class}:#{path}>) end |
#pretty_print(q) ⇒ Object
72 73 74 |
# File 'lib/invfs/zip.rb', line 72 def pretty_print(q) q.text inspect end |
#read(path) ⇒ Object
call-seq:
read(path) -> string
REQUIRED method for VFS.
57 58 59 |
# File 'lib/invfs/zip.rb', line 57 def read(path) zipfile.read(path) end |
#size(path) ⇒ Object
call-seq:
size(path) -> integer for file size
REQUIRED method for VFS.
47 48 49 |
# File 'lib/invfs/zip.rb', line 47 def size(path) zipfile.size(path) end |
#to_path ⇒ Object
call-seq:
to_path -> string
REQUIRED method for VFS.
This value MUST be not modifying in each objects.
27 28 29 |
# File 'lib/invfs/zip.rb', line 27 def to_path path end |
#to_s ⇒ Object
optional method for VFS.
64 65 66 |
# File 'lib/invfs/zip.rb', line 64 def to_s %(#{path} (#{self.class})) end |