Class: XMLRPC::Client::Proxy (Ruby 2.2.3)
Description: Class : XMLRPC::Client::Proxy - Ruby 2.2.3

- Home
- Core 2.2.3
- Std-lib 2.2.3
- Downloads

Support for the Ruby 2.2 series has ended. See here for reference.

### Home Classes Methods

### In Files

- xmlrpc/client.rb

### Parent

Object

### Methods

- ::new
- #method_missing

### Class/Module Index

Quicksearch

- NQXML
- NQXML::Node
- XMLRPC
- XMLRPC::Base64
- XMLRPC::BasicServer
- XMLRPC::CGIServer
- XMLRPC::Client
- XMLRPC::Client::Proxy
- XMLRPC::Config
- XMLRPC::Convert
- XMLRPC::Create
- XMLRPC::DateTime
- XMLRPC::FaultException
- XMLRPC::Marshal
- XMLRPC::Marshallable
- XMLRPC::ModRubyServer
- XMLRPC::ParseContentType
- XMLRPC::ParserWriterChooseMixin
- XMLRPC::Server
- XMLRPC::Service
- XMLRPC::Service::BasicInterface
- XMLRPC::Service::Interface
- XMLRPC::Service::PublicInstanceMethodsInterface
- XMLRPC::WEBrickServlet
- XMLRPC::XMLParser
- XMLRPC::XMLParser::AbstractStreamParser
- XMLRPC::XMLParser::AbstractTreeParser
- XMLRPC::XMLParser::LibXMLStreamParser
- XMLRPC::XMLParser::LibXMLStreamParser::LibXMLStreamListener
- XMLRPC::XMLParser::NQXMLParser
- XMLRPC::XMLParser::NQXMLStreamParser
- XMLRPC::XMLParser::NQXMLStreamParser::XMLRPCParser
- XMLRPC::XMLParser::NQXMLTreeParser
- XMLRPC::XMLParser::REXMLStreamParser
- XMLRPC::XMLParser::REXMLStreamParser::StreamListener
- XMLRPC::XMLParser::StreamParserMixin
- XMLRPC::XMLParser::XMLParser
- XMLRPC::XMLParser::XMLScanStreamParser
- XMLRPC::XMLParser::XMLScanStreamParser::XMLScanParser
- XMLRPC::XMLParser::XMLStreamParser
- XMLRPC::XMLParser::XMLTreeParser
- XMLRPC::XMLWriter
- XMLRPC::XMLWriter::Abstract
- XMLRPC::XMLWriter::Simple
- XMLRPC::XMLWriter::XMLParser

No matching classes.

# XMLRPC::Client::Proxy

XML-RPC calls look nicer!

You can call any method onto objects of that class - the object handles #method_missing and will forward the method call to a XML-RPC server.

Don't use this class directly, instead use the public instance method XMLRPC::Client#proxy or XMLRPC::Client#proxy2.

    require "xmlrpc/client"

    server = XMLRPC::Client.new("www.ruby-lang.org", "/RPC2", 80)

    michael  = server.proxy("michael")
    michael2 = server.proxy("michael", 4)

    # both calls should return the same value '9'.
    p michael.add(4,5)
    p michael2.add(5)

### Public Class Methods

new(server, prefix, args=[], meth=:call, delim=".") click to toggle source

Creates an object which provides #method_missing.

The given `server` must be an instance of XMLRPC::Client, which is the XML-RPC server to be used for a XML-RPC call.

`prefix` and `delim` will be prepended to the method name called onto this object.

An optional parameter `meth` is the method to use for a RPC. It can be either, call, call2, call_async, call2_async

`args` are arguments which are automatically given to every XML-RPC call before being provided through `method_missing`.

                   # File xmlrpc/client.rb, line 591
    def initialize(server, prefix, args=[], meth=:call, delim=".")
      @server = server
      @prefix = prefix ? prefix + delim : ""
      @args   = args
      @meth   = meth
    end

### Public Instance Methods

method_missing(mid, *args) click to toggle source

Every method call is forwarded to the XML-RPC server defined in XMLRPC::Client::Proxy#new.

Note: Inherited methods from class Object cannot be used as XML-RPC names, because they get around `method_missing`.

                   # File xmlrpc/client.rb, line 603
    def method_missing(mid, *args)
      pre = @prefix + mid.to_s
      arg = @args + args
      @server.send(@meth, pre, *arg)
    end