Class: OfflineSort::Chunk::InputOutput::Marshal

Inherits:
Base
  • Object
show all
Defined in:
lib/offline_sort/chunk/input_output/marshal.rb

Constant Summary

Constants inherited from Base

Base::MethodNotImplementedError

Instance Attribute Summary

Attributes inherited from Base

#io

Instance Method Summary collapse

Methods inherited from Base

#close, #each, #flush, #initialize, #rewind, #write_entries

Constructor Details

This class inherits a constructor from OfflineSort::Chunk::InputOutput::Base

Instance Method Details

#read_entryObject



5
6
7
# File 'lib/offline_sort/chunk/input_output/marshal.rb', line 5

def read_entry
  ::Marshal.load(io)
end

#write_entry(entry) ⇒ Object



9
10
11
# File 'lib/offline_sort/chunk/input_output/marshal.rb', line 9

def write_entry(entry)
  io.write(::Marshal.dump(entry))
end