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

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) {|@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) ⇒ Object

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)

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