Class: Arpie::XMLRPCServerProtocol

Inherits:
XMLRPCProtocol show all
Defined in:
lib/arpie/xmlrpc.rb

Constant Summary

Constants inherited from Protocol

Protocol::CAN_SEPARATE_MESSAGES

Instance Attribute Summary

Attributes inherited from XMLRPCProtocol

#parser, #writer

Instance Method Summary collapse

Methods inherited from Protocol

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

Instance Method Details

#from(binary) {|RPCall.new(ns, meth, vv[1])| ... } ⇒ Object

Yields:

  • (RPCall.new(ns, meth, vv[1]))


56
57
58
59
60
61
62
# File 'lib/arpie/xmlrpc.rb', line 56

def from binary
  setup
  vv = @parser.parseMethodCall(binary)
  ns, meth = vv[0].split('.')
  meth.nil? and begin meth, ns = ns, nil end
  yield RPCall.new(ns, meth, vv[1])
end

#to(object) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/arpie/xmlrpc.rb', line 44

def to object
  setup
  case object
    when Exception
      # TODO: wrap XMLFault
      raise NotImplementedError, "Cannot encode exceptions"

    else
      @writer.methodResponse(true, object)
  end
end