Class: XMLRPC::Service::Interface

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

Overview

Class which wraps a XMLRPC::Service::Interface definition, used by XMLRPC::BasicServer#add_handler

Instance Attribute Summary

Attributes inherited from BasicInterface

#methods, #prefix

Instance Method Summary collapse

Methods inherited from BasicInterface

#add_method

Constructor Details

#initialize(prefix, &p) ⇒ Interface

Returns a new instance of Interface.



113
114
115
116
117
# File 'lib/xmlrpc/utils.rb', line 113

def initialize(prefix, &p)
  raise "No interface specified" if p.nil?
  super(prefix)
  instance_eval(&p)
end

Instance Method Details

#get_methods(obj, delim = ".") ⇒ Object



119
120
121
122
123
124
# File 'lib/xmlrpc/utils.rb', line 119

def get_methods(obj, delim=".")
  prefix = @prefix + delim
  @methods.collect { |name, meth, sig, help|
    [prefix + name.to_s, obj.method(meth).to_proc, sig, help]
  }
end