Class: Arpie::MarshalProtocol

Inherits:
Protocol
  • Object
show all
Defined in:
lib/arpie/protocol.rb

Overview

A procotol that simply Marshals all data sent over this protocol. Served as an example, but a viable choice for ruby-only production code. Messages are arbitary objects.

Constant Summary

Constants inherited from Protocol

Protocol::CAN_SEPARATE_MESSAGES

Instance Method Summary collapse

Methods inherited from Protocol

#again!, #assemble, #assemble!, #bogon!, #gulp!, #incomplete!

Instance Method Details

#from(binary) {|Marshal.load(binary)| ... } ⇒ Object

Yields:

  • (Marshal.load(binary))


316
317
318
# File 'lib/arpie/protocol.rb', line 316

def from binary
  yield Marshal.load(binary)
end

#to(object) ⇒ Object



312
313
314
# File 'lib/arpie/protocol.rb', line 312

def to object
  Marshal.dump(object)
end