Class: XMLRPC::Service::Interface

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

Overview

class which wraps a Service Interface definition, used by 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.



106
107
108
109
110
# File 'lib/xmlrpc/utils.rb', line 106

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



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

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