Adds aBlock
to the list of handlers, with name
as the name of the method.
Parameters signature
and help
are used by the Introspection method if specified, where signature
is either an Array containing strings each representing a type of it’s signature (the first is the return value) or an Array of Arrays if the method has multiple signatures.
Value type-names are “int, boolean, double, string, dateTime.iso8601
, base64, array, struct”.
Parameter help
is a String with information about how to call this method etc.
When a method fails, it can tell the client by throwing an XMLRPC::FaultException
like in this example:
s.add_handler("michael.div") do |a,b| if b == 0 raise XMLRPC::FaultException.new(1, "division by zero") else a / b end end
In the case of b==0
the client gets an object back of type XMLRPC::FaultException
that has a faultCode
and faultString
field.
This is the second form of ((<add_handler|XMLRPC::BasicServer#add_handler>)). To add an object write:
server.add_handler("michael", MyHandlerClass.new)
All public methods of MyHandlerClass are accessible to the XML-RPC clients by michael."name of method"
. This is where the class_delim
in XMLRPC::BasicServer.new
plays it’s role, a XML-RPC method-name is defined by prefix
+ class_delim
+ "name of method"
.
The third form of +add_handler is to use XMLRPC::Service::Interface
to generate an object, which represents an interface (with signature and help text) for a handler class.
The interface
parameter must be an instance of XMLRPC::Service::Interface
. Adds all methods of obj
which are defined in the interface
to the server.
This is the recommended way of adding services to a server!
Calls the given block once for each key
, value
pair in the database. Deletes all entries for which the block returns true.
Returns self
.
Returns the length of the hash value of the digest.
This method should be overridden by each implementation subclass. If not, digest_obj.digest().length() is returned.
Returns the block length of the digest.
This method is overridden by each implementation subclass.
Similar to decode
with the difference that decode
expects one distinct value represented in der
. decode_all
on the contrary decodes a sequence of sequential BER/DER values lined up in der
and returns them as an array.
ders = File.binread('asn1data_seq') asn1_ary = OpenSSL::ASN1.decode_all(ders)
Generate an File
Upload Input element as a string.
The attributes of the element can be specified as three arguments, name
, size
, and maxlength
. maxlength
is the maximum length of the file’s name, not of the file’s contents.
Alternatively, the attributes can be specified as a hash.
See multipart_form()
for forms that include file uploads.
file_field("name") # <INPUT TYPE="file" NAME="name" SIZE="20"> file_field("name", 40) # <INPUT TYPE="file" NAME="name" SIZE="40"> file_field("name", 40, 100) # <INPUT TYPE="file" NAME="name" SIZE="40" MAXLENGTH="100"> file_field("NAME" => "name", "SIZE" => 40) # <INPUT TYPE="file" NAME="name" SIZE="40">
Synonym for CGI::escapeElement(str)
The length of the range represented in Content-Range: header.
Temporarily turn off warnings. Intended for tests only.
Temporarily turn off warnings. Intended for tests only.
Remove any non-printable characters and make the text suitable for printing.
Displays an error statement
to the error output location. Asks a question
if given.
Displays a warning statement
to the warning output location. Asks a question
if given.
Invokes system, but silences all output.
Change the current process’s real and effective user ID to that specified by user. Returns the new user ID. Not available on all platforms.
[Process.uid, Process.euid] #=> [0, 0] Process::UID.change_privilege(31) #=> 31 [Process.uid, Process.euid] #=> [31, 31]
Set
the effective user ID, and if possible, the saved user ID of the process to the given user. Returns the new effective user ID. Not available on all platforms.
[Process.uid, Process.euid] #=> [0, 0] Process::UID.grant_privilege(31) #=> 31 [Process.uid, Process.euid] #=> [0, 31]
Returns true
if the real and effective user IDs of a process may be exchanged on the current platform.
Returns true
if the current platform has saved user ID functionality.