Class: Zip::FileSystem::ZipFsDirIterator
- Inherits:
-
Object
- Object
- Zip::FileSystem::ZipFsDirIterator
- Includes:
- Enumerable
- Defined in:
- lib/zip/filesystem.rb
Overview
:nodoc:all
Instance Method Summary collapse
- #close ⇒ Object
- #each(&a_proc) ⇒ Object
-
#initialize(filenames) ⇒ ZipFsDirIterator
constructor
A new instance of ZipFsDirIterator.
- #read ⇒ Object
- #rewind ⇒ Object
- #seek(position) ⇒ Object
- #tell ⇒ Object
Constructor Details
#initialize(filenames) ⇒ ZipFsDirIterator
Returns a new instance of ZipFsDirIterator.
519 520 521 522 |
# File 'lib/zip/filesystem.rb', line 519 def initialize(filenames) @filenames = filenames @index = 0 end |
Instance Method Details
#close ⇒ Object
524 525 526 |
# File 'lib/zip/filesystem.rb', line 524 def close @filenames = nil end |
#each(&a_proc) ⇒ Object
528 529 530 531 532 |
# File 'lib/zip/filesystem.rb', line 528 def each(&a_proc) raise IOError, 'closed directory' if @filenames.nil? @filenames.each(&a_proc) end |
#read ⇒ Object
534 535 536 537 538 |
# File 'lib/zip/filesystem.rb', line 534 def read raise IOError, 'closed directory' if @filenames.nil? @filenames[(@index += 1) - 1] end |
#rewind ⇒ Object
540 541 542 543 544 |
# File 'lib/zip/filesystem.rb', line 540 def rewind raise IOError, 'closed directory' if @filenames.nil? @index = 0 end |
#seek(position) ⇒ Object
546 547 548 549 550 |
# File 'lib/zip/filesystem.rb', line 546 def seek(position) raise IOError, 'closed directory' if @filenames.nil? @index = position end |
#tell ⇒ Object
552 553 554 555 556 |
# File 'lib/zip/filesystem.rb', line 552 def tell raise IOError, 'closed directory' if @filenames.nil? @index end |