Class: Ione::Rpc::StandardCodec
Overview
A codec that works with encoders like JSON, MessagePack, YAML and others
that follow the informal Ruby standard of having a #dump
method that
encodes and a #load
method that decodes.
Instance Method Summary collapse
-
#decode_message(str) ⇒ Object
Uses the delegate's
#load
to decode the message. -
#encode_message(message) ⇒ Object
Uses the delegate's
#dump
to encode the message. -
#initialize(delegate) ⇒ StandardCodec
constructor
A new instance of StandardCodec.
Methods inherited from Codec
#decode, #encode, #recode, #recoding?
Constructor Details
#initialize(delegate) ⇒ StandardCodec
Returns a new instance of StandardCodec.
260 261 262 |
# File 'lib/ione/rpc/codec.rb', line 260 def initialize(delegate) @delegate = delegate end |
Instance Method Details
#decode_message(str) ⇒ Object
Uses the delegate's #load
to decode the message
270 271 272 |
# File 'lib/ione/rpc/codec.rb', line 270 def (str) @delegate.load(str) end |
#encode_message(message) ⇒ Object
Uses the delegate's #dump
to encode the message
265 266 267 |
# File 'lib/ione/rpc/codec.rb', line 265 def () @delegate.dump() end |