Module: Bones::RPC::Adapter::Base

Defined in:
lib/bones/rpc/adapter/base.rb

Instance Method Summary collapse

Instance Method Details

#adapter_nameObject

Raises:

  • (NotImplementedError)

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

Raises:

  • (NotImplementedError)

18
19
20
# File 'lib/bones/rpc/adapter/base.rb', line 18

def pack(message, buffer = "")
  raise NotImplementedError, "Adapter #{self.name} does not implement #pack"
end

#packer(buffer) ⇒ Object

Raises:

  • (NotImplementedError)

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(message, buffer = "")
  pack(message, buffer)
end

#unpack(buffer) ⇒ Object

Raises:

  • (NotImplementedError)

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

Raises:

  • (NotImplementedError)

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