Class: Zip::ZipFileSystem::ZipFsDirIterator
- Includes:
- Enumerable
- Defined in:
- lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb
Overview
:nodoc:all
Instance Method Summary collapse
- #close ⇒ Object
- #each(&aProc) ⇒ Object
-
#initialize(arrayOfFileNames) ⇒ ZipFsDirIterator
constructor
A new instance of ZipFsDirIterator.
- #read ⇒ Object
- #rewind ⇒ Object
- #seek(anIntegerPosition) ⇒ Object
- #tell ⇒ Object
Methods included from Enumerable
Constructor Details
#initialize(arrayOfFileNames) ⇒ ZipFsDirIterator
Returns a new instance of ZipFsDirIterator.
519 520 521 522 |
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 519 def initialize(arrayOfFileNames) @fileNames = arrayOfFileNames @index = 0 end |
Instance Method Details
#close ⇒ Object
524 525 526 |
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 524 def close @fileNames = nil end |
#each(&aProc) ⇒ Object
528 529 530 531 |
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 528 def each(&aProc) raise IOError, "closed directory" if @fileNames == nil @fileNames.each(&aProc) end |
#read ⇒ Object
533 534 535 536 |
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 533 def read raise IOError, "closed directory" if @fileNames == nil @fileNames[(@index+=1)-1] end |
#rewind ⇒ Object
538 539 540 541 |
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 538 def rewind raise IOError, "closed directory" if @fileNames == nil @index = 0 end |
#seek(anIntegerPosition) ⇒ Object
543 544 545 546 |
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 543 def seek(anIntegerPosition) raise IOError, "closed directory" if @fileNames == nil @index = anIntegerPosition end |
#tell ⇒ Object
548 549 550 551 |
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 548 def tell raise IOError, "closed directory" if @fileNames == nil @index end |