Class: Warc::Stream::Plain
Constant Summary
Constants inherited
from Warc::Stream
DEFAULT_OPTS
Instance Attribute Summary
Attributes inherited from Warc::Stream
#parser
Instance Method Summary
collapse
#close, #each, #record, #size
Constructor Details
#initialize(fh, options = {}, &block) ⇒ Plain
Returns a new instance of Plain.
5
6
7
8
|
# File 'lib/warc/stream/plain.rb', line 5
def initialize(fh,options={},&block)
@ext = '.warc'
super(fh,options,&block)
end
|
Instance Method Details
#read_record ⇒ Object
10
11
12
13
14
15
16
|
# File 'lib/warc/stream/plain.rb', line 10
def read_record
begin
self.parser.parse(@file_handle)
rescue EOFError return nil
end
end
|
#write_record(record) ⇒ Object
18
19
20
21
|
# File 'lib/warc/stream/plain.rb', line 18
def write_record(record)
super
record.dump_to(@file_handle)
end
|