Similar to XMLRPC::Client#call
, however can be called concurrently and use a new connection for each request. In contrast to the corresponding method without the _async
suffix, which use connect-alive (one connection for all requests).
Note, that you have to use Thread
to call these methods concurrently. The following example calls two methods concurrently:
Thread.new { p client.call_async("michael.add", 4, 5) } Thread.new { p client.call_async("michael.div", 7, 9) }
Same as XMLRPC::Client#call2
, but can be called concurrently.
See also XMLRPC::Client#call_async
Similar to XMLRPC::Client#multicall
, however can be called concurrently and use a new connection for each request. In contrast to the corresponding method without the _async
suffix, which use connect-alive (one connection for all requests).
Note, that you have to use Thread
to call these methods concurrently. The following example calls two methods concurrently:
Thread.new { p client.multicall_async("michael.add", 4, 5) } Thread.new { p client.multicall_async("michael.div", 7, 9) }
Same as XMLRPC::Client#multicall2
, but can be called concurrently.
See also XMLRPC::Client#multicall_async
Similar to XMLRPC::Client#proxy
, however can be called concurrently and use a new connection for each request. In contrast to the corresponding method without the _async
suffix, which use connect-alive (one connection for all requests).
Note, that you have to use Thread
to call these methods concurrently. The following example calls two methods concurrently:
Thread.new { p client.proxy_async("michael.add", 4, 5) } Thread.new { p client.proxy_async("michael.div", 7, 9) }
Same as XMLRPC::Client#proxy2
, but can be called concurrently.
See also XMLRPC::Client#proxy_async
Returns true
, if the arity of obj
matches n_args
Calls the given block once for each key
, value
pair in the database.
Returns self
.
Returns the one-character string which cause Encoding::UndefinedConversionError
.
ec = Encoding::Converter.new("ISO-8859-1", "EUC-JP") begin ec.convert("\xa0") rescue Encoding::UndefinedConversionError puts $!.error_char.dump #=> "\xC2\xA0" p $!.error_char.encoding #=> #<Encoding:UTF-8> end
Returns a conversion path.
p Encoding::Converter.search_convpath("ISO-8859-1", "EUC-JP") #=> [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>], # [#<Encoding:UTF-8>, #<Encoding:EUC-JP>]] p Encoding::Converter.search_convpath("ISO-8859-1", "EUC-JP", universal_newline: true) or p Encoding::Converter.search_convpath("ISO-8859-1", "EUC-JP", newline: :universal) #=> [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>], # [#<Encoding:UTF-8>, #<Encoding:EUC-JP>], # "universal_newline"] p Encoding::Converter.search_convpath("ISO-8859-1", "UTF-32BE", universal_newline: true) or p Encoding::Converter.search_convpath("ISO-8859-1", "UTF-32BE", newline: :universal) #=> [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>], # "universal_newline", # [#<Encoding:UTF-8>, #<Encoding:UTF-32BE>]]
Returns a new Fiddle::Pointer
instance at the memory address of the given name
symbol.
Raises a DLError
if the name
doesn’t exist.
Calls the given block once for each byte in the stream.
Generates string
with length
number of pseudo-random bytes.
Pseudo-random byte sequences generated by ::pseudo_bytes
will be unique if they are of sufficient length, but are not necessarily unpredictable.
Example: OpenSSL::Random.pseudo_bytes(12) => "..."
Generate a sequence of checkbox elements, as a String.
The checkboxes will all have the same name
attribute. Each checkbox is followed by a label. There will be one checkbox for each value. Each value can be specified as a String, which will be used both as the value of the VALUE attribute and as the label for that checkbox. A single-element array has the same effect.
Each value can also be specified as a three-element array. The first element is the VALUE attribute; the second is the label; and the third is a boolean specifying whether this checkbox is CHECKED.
Each value can also be specified as a two-element array, by omitting either the value element (defaults to the same as the label), or the boolean checked element (defaults to false).
checkbox_group("name", "foo", "bar", "baz") # <INPUT TYPE="checkbox" NAME="name" VALUE="foo">foo # <INPUT TYPE="checkbox" NAME="name" VALUE="bar">bar # <INPUT TYPE="checkbox" NAME="name" VALUE="baz">baz checkbox_group("name", ["foo"], ["bar", true], "baz") # <INPUT TYPE="checkbox" NAME="name" VALUE="foo">foo # <INPUT TYPE="checkbox" CHECKED NAME="name" VALUE="bar">bar # <INPUT TYPE="checkbox" NAME="name" VALUE="baz">baz checkbox_group("name", ["1", "Foo"], ["2", "Bar", true], "Baz") # <INPUT TYPE="checkbox" NAME="name" VALUE="1">Foo # <INPUT TYPE="checkbox" CHECKED NAME="name" VALUE="2">Bar # <INPUT TYPE="checkbox" NAME="name" VALUE="Baz">Baz checkbox_group("NAME" => "name", "VALUES" => ["foo", "bar", "baz"]) checkbox_group("NAME" => "name", "VALUES" => [["foo"], ["bar", true], "baz"]) checkbox_group("NAME" => "name", "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"])
Iterates through the header names and values, passing in the name and value to the code block supplied.
Example:
response.header.each_header {|key,value| puts "#{key} = #{value}" }
Iterates through the header names in the header, passing each header name to the code block.
Iterates through header values, passing each value to the code block.
As for each_header
, except the keys are provided in capitalized form.
Note that header names are capitalized systematically; capitalization may not match that used by the remote HTTP
server in its response.
Visit all subnodes of self
recursively
Invokes system, but silences all output.