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



7
8
9
# File 'lib/offline_sort/chunk/input_output/marshal.rb', line 7

def read_entry
  ::Marshal.load(io) # rubocop:disable Security/MarshalLoad, this is loading from a trusted source
end

#write_entry(entry) ⇒ Object



11
12
13
# File 'lib/offline_sort/chunk/input_output/marshal.rb', line 11

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