module PackServ::DefaultProtocol

Constants

HEADER_FORMAT
HEADER_LENGTH

Public Instance Methods

create(obj, type = '', id = nil) click to toggle source
# File lib/packserv/default_protocol.rb, line 8
def create(obj, type = '', id = nil)
  {
    'ver'     => PackServ::VERSION,
    'id'      => id || obj.object_id,
    'type'    => type,
    'payload' => obj
  }
end
extract(msg) click to toggle source
# File lib/packserv/default_protocol.rb, line 17
def extract(msg)
  msg['payload']
end