Class: Arpie::MarshalProtocol
- 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
Constants included from Arpie
Instance Attribute Summary
Attributes inherited from Protocol
Instance Method Summary collapse
- #from(binary) {|Marshal.load(binary)| ... } ⇒ Object
- #to(object) {|Marshal.dump(object)| ... } ⇒ Object
Methods inherited from Protocol
#again!, #assemble, #assemble!
Methods included from Arpie
Instance Method Details
#from(binary) {|Marshal.load(binary)| ... } ⇒ Object
296 297 298 |
# File 'lib/arpie/protocol.rb', line 296 def from binary yield Marshal.load(binary) end |
#to(object) {|Marshal.dump(object)| ... } ⇒ Object
292 293 294 |
# File 'lib/arpie/protocol.rb', line 292 def to object yield Marshal.dump(object) end |