module Comandante::Helper

Overview

Some helper functions

Defined in:

lib/comandante/src/comandante/helper.cr
comandante/msgpack.cr

Class Method Summary

Class Method Detail

def self.read_msgpack(file, data) #

Reads data from file - first/only object in file

  • Asserts file exists
  • Raises MessagePack::EofError if file is empty
  • Raises MessagePack::TypeCastError if not the correct type

NOTE you pass an object of the desired type


[View source]
def self.read_msgpack(file, data, &) : Nil #
  • Asserts file exists
  • Raises MessagePack::TypeCastError if not the correct type

NOTE you pass an object of the desired type


[View source]
def self.write_msgpack(data, file, mode = "w") : Nil #

Writes serializable data to file


[View source]