Class: Arpie::XMLRPCClientProtocol

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

Overview

A XMLRPC Protocol based on rubys xmlrpc stdlib. This does not encode HTTP headers; usage together with a real webserver is advised.

Constant Summary

Constants inherited from Protocol

Protocol::CAN_SEPARATE_MESSAGES

Constants included from Arpie

MTU

Instance Attribute Summary

Attributes inherited from XMLRPCProtocol

#parser, #writer

Attributes inherited from Protocol

#metabuffer, #stowbuffer

Instance Method Summary collapse

Methods inherited from Protocol

#again!, #assemble, #assemble!

Methods included from Arpie

#bogon!, #incomplete!

Instance Method Details

#from(binary) {|@parser.parseMethodResponse(binary)[1]| ... } ⇒ Object

Yields:

  • (@parser.parseMethodResponse(binary)[1])


35
36
37
38
# File 'lib/arpie/xmlrpc.rb', line 35

def from binary
  setup
  yield @parser.parseMethodResponse(binary)[1]
end

#to(object) {|@writer.methodCall((object.ns.nil? ? '' : object.ns + '.') + object.meth, *object.argv)| ... } ⇒ Object

Yields:

  • (@writer.methodCall((object.ns.nil? ? '' : object.ns + '.') + object.meth, *object.argv))

Raises:

  • (ArgumentError)


27
28
29
30
31
32
33
# File 'lib/arpie/xmlrpc.rb', line 27

def to object
  setup
  raise ArgumentError, "Can only encode Arpie::RPCall" unless
    object.is_a?(Arpie::RPCall)

  yield @writer.methodCall((object.ns.nil? ? '' : object.ns + '.') + object.meth, *object.argv)
end