Sha256: d72d46bcb6a22cb2fa180c63531a66028285a9b2a843aa41ec82924e2d57b687

Contents?: true

Size: 276 Bytes

Versions: 41

Compression:

Stored size: 276 Bytes

Contents

module Specjour
  module Protocol
    TERMINATOR = "|ruojceps|"
    TERMINATOR_REGEXP = /#{TERMINATOR}$/

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

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

Version data entries

41 entries across 41 versions & 3 rubygems

Version Path
specjour-0.1.12 lib/specjour/protocol.rb