scanf

scanf(str) Instance Public methods Scans the current string until the match is exhausted, yielding each match as it is encountered in the string. A block is not necessary though, as the results will simply be aggregated into the final array. "123 456".block_scanf("%d") # => [123, 456] If a block is given, the value from that is returned from the yield is added to an output array. "123 456".block_scanf("%d) do |digit,| # the ',' unpacks the Array digit + 100 end # => [223,

scanf

scanf(fstr) Instance Public methods Scans the current string. If a block is given, it functions exactly like block_scanf. arr = "123 456".scanf("%d%d") # => [123, 456] require 'pp' "this 123 read that 456 other".scanf("%s%d%s") {|m| pp m} # ["this", 123, "read"] # ["that", 456, "other"] # => [["this", 123, "read"], ["that", 456, "other"]] See Scanf for details on creating a format string. You will need to require 'scanf' to use #scanf

new

new(text, name, rw, comment, singleton = false) Class Public methods Creates a new Attr with body text, name, read/write status rw and comment. singleton marks this as a class attribute.

find

find() Instance Public methods

get

get(*args, &block) Instance Public methods Define a route that only recognizes HTTP GET. For supported arguments, see match get 'bacon', to: 'food#bacon'

hostname=

hostname=(v) Instance Public methods set the host part of the URI as the argument with brackets for IPv6 addresses. This method is same as #host= except the argument can be bare IPv6 address. u = URI(âfoo/barâ) p u.to_s #=> âfoo/barâ u.hostname = â::1â p u.to_s #=> â[::1]/barâ If the arugument seems IPv6 address, it is wrapped by brackets.

thread_variable_get

thr.thread_variable_get(key) â obj or nil Instance Public methods Returns the value of a thread local variable that has been set. Note that these are different than fiber local values. For fiber local values, please see #[] and #[]=. Thread local values are carried along with threads, and do not respect fibers. For example: Thread.new { Thread.current.thread_variable_set("foo", "bar") # set a thread local Thread.current["foo"] = "bar" # set a fiber local

append

append(mailbox, message, flags = nil, date_time = nil) Instance Public methods Sends a APPEND command to append the message to the end of the mailbox. The optional flags argument is an array of flags to initially passing to the new message. The optional date_time argument specifies the creation time to assign to the new message; it defaults to the current time. For example: imap.append("inbox", <<EOF.gsub(/\n/, "\r\n"), [:Seen], Time.now) Subject: hello From: shugo@ruby-lang

set_eventloop_tick

set_eventloop_tick(tick) Class Public methods def ::mainloop_abort_on_exception MultiTkIp.mainloop_abort_on_exception end def ::mainloop_abort_on_exception=(mode) MultiTkIp.mainloop_abort_on_exception=(mode) end

validate_digest_response

validate_digest_response(request, realm, &password_procedure) Instance Public methods Returns false unless the request credentials response value matches the expected value. First try the password as a ha1 digest password. If this fails, then try it as a plain text password.