Module: Bones::RPC::Adapter::Base
- Defined in:
- lib/bones/rpc/adapter/base.rb
Instance Method Summary collapse
- #adapter_name ⇒ Object
- #deserialize(buffer = "") ⇒ Object
- #pack(message, buffer = "") ⇒ Object
- #packer(buffer) ⇒ Object
- #serialize(message, buffer = "") ⇒ Object
- #unpack(buffer) ⇒ Object
- #unpacker(buffer) ⇒ Object
Instance Method Details
#adapter_name ⇒ Object
7 8 9 |
# File 'lib/bones/rpc/adapter/base.rb', line 7 def adapter_name raise NotImplementedError, "Adapter #{self.name} does not implement #adapter_name" end |
#deserialize(buffer = "") ⇒ Object
11 12 13 14 15 16 |
# File 'lib/bones/rpc/adapter/base.rb', line 11 def deserialize(buffer = "") if buffer.is_a?(String) buffer = StringIO.new(buffer) end unpack(buffer) end |
#pack(message, buffer = "") ⇒ Object
18 19 20 |
# File 'lib/bones/rpc/adapter/base.rb', line 18 def pack(, buffer = "") raise NotImplementedError, "Adapter #{self.name} does not implement #pack" end |
#packer(buffer) ⇒ Object
22 23 24 |
# File 'lib/bones/rpc/adapter/base.rb', line 22 def packer(buffer) raise NotImplementedError, "Adapter #{self.name} does not implement #packer" end |
#serialize(message, buffer = "") ⇒ Object
26 27 28 |
# File 'lib/bones/rpc/adapter/base.rb', line 26 def serialize(, buffer = "") pack(, buffer) end |
#unpack(buffer) ⇒ Object
30 31 32 |
# File 'lib/bones/rpc/adapter/base.rb', line 30 def unpack(buffer) raise NotImplementedError, "Adapter #{self.name} does not implement #unpack" end |
#unpacker(buffer) ⇒ Object
34 35 36 |
# File 'lib/bones/rpc/adapter/base.rb', line 34 def unpacker(buffer) raise NotImplementedError, "Adapter #{self.name} does not implement #unpacker" end |