Class: Tar::HeaderReader
- Inherits:
-
Object
- Object
- Tar::HeaderReader
- Defined in:
- lib/tar/header_reader.rb
Instance Method Summary collapse
-
#initialize(io) ⇒ HeaderReader
constructor
A new instance of HeaderReader.
- #read ⇒ Object
Constructor Details
#initialize(io) ⇒ HeaderReader
Returns a new instance of HeaderReader.
12 13 14 |
# File 'lib/tar/header_reader.rb', line 12 def initialize(io) @io = io end |
Instance Method Details
#read ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/tar/header_reader.rb', line 16 def read record = read_record if empty?(record) return nil if empty?(read_record) raise InvalidArchive, "empty header" end Header.parse(record) end |