Module: Specjour::Protocol

Included in:
Connection, Loader, Printer, Worker
Defined in:
lib/specjour/protocol.rb

Constant Summary

TERMINATOR =
"|ruojceps|"
TERMINATOR_REGEXP =
/#{TERMINATOR}$/

Instance Method Summary (collapse)

Instance Method Details

- (Object) dump_object(data)



6
7
8
# File 'lib/specjour/protocol.rb', line 6

def dump_object(data)
  Marshal.dump(data) << TERMINATOR
end

- (Object) load_object(data)



10
11
12
# File 'lib/specjour/protocol.rb', line 10

def load_object(data)
  Marshal.load(data.sub(TERMINATOR_REGEXP, ''))
end