Class: XMLRPC::Service::BasicInterface

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

Overview

base class for Service Interface definitions, used by 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.



66
67
68
69
# File 'lib/xmlrpc/utils.rb', line 66

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

Instance Attribute Details

#methodsObject (readonly)

Returns the value of attribute methods



64
65
66
# File 'lib/xmlrpc/utils.rb', line 64

def methods
  @methods
end

#prefixObject (readonly)

Returns the value of attribute prefix



64
65
66
# File 'lib/xmlrpc/utils.rb', line 64

def prefix
  @prefix
end

Instance Method Details

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



71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/xmlrpc/utils.rb', line 71

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