Class: Tar::Reader
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(io, **encoding_options) ⇒ Reader
constructor
A new instance of Reader.
Constructor Details
#initialize(io, **encoding_options) ⇒ Reader
Returns a new instance of Reader.
11 12 13 14 15 |
# File 'lib/tar/reader.rb', line 11 def initialize(io, **) @io = io = @header_reader = HeaderReader.new(@io) end |
Instance Method Details
#each ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/tar/reader.rb', line 17 def each return to_enum unless block_given? loop do header = @header_reader.read break if header.nil? file_reader = FileReader.new(header, @io, **) yield file_reader file_reader.skip_to_next_record end end |