Class: XMLRPC::Service::BasicInterface

Inherits:
Object
  • Object
show all
Defined in:
lib/xmlrpc/utils.rb

Overview

Base class for XMLRPC::Service::Interface definitions, used by XMLRPC::BasicServer#add_handler

Direct Known Subclasses

Interface, PublicInstanceMethodsInterface

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prefix) ⇒ BasicInterface

Returns a new instance of BasicInterface.



73
74
75
76
# File 'lib/xmlrpc/utils.rb', line 73

def initialize(prefix)
  @prefix = prefix
  @methods = []
end

Instance Attribute Details

#methodsObject (readonly)

Returns the value of attribute methods.



71
72
73
# File 'lib/xmlrpc/utils.rb', line 71

def methods
  @methods
end

#prefixObject (readonly)

Returns the value of attribute prefix.



71
72
73
# File 'lib/xmlrpc/utils.rb', line 71

def prefix
  @prefix
end

Instance Method Details

#add_method(sig, help = nil, meth_name = nil) ⇒ Object



78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/xmlrpc/utils.rb', line 78

def add_method(sig, help=nil, meth_name=nil)
  mname = nil
  sig = [sig] if sig.kind_of? String

  sig = sig.collect do |s|
    name, si = parse_sig(s)
    raise "Wrong signatures!" if mname != nil and name != mname
    mname = name
    si
  end

  @methods << [mname, meth_name || mname, sig, help]
end