class Kernel Flashcards
exit(p1 = v1)
Initiates the termination of the Ruby script by raising the SystemExit exception. This exception may be caught. The optional parameter is used to return a status code to the invoking environment. true and FALSE of status means success and failure respectively. The interpretation of other integer values are system dependent.
begin exit puts "never get here" rescue SystemExit puts "rescued a SystemExit exception" end puts "after begin block"
rescued a SystemExit exception
after begin block
at_exit()
Converts block to a Proc object (and therefore binds it at the point of call) and registers it for execution when the program exits. If multiple handlers are registered, they are executed in reverse order of registration.
def do_at_exit(str1) at_exit { print str1 } end at_exit { puts "cruel world" } do_at_exit("goodbye ") exit
URI(uri)
Public Class Method
Returns uri converted to a URI object.
open(path [, mode [, perm]] [, opt]) → io or nil
open(path [, mode [, perm]] [, opt]) {|io| block } → obj
(Public Class Method)
Creates an IO object connected to the given stream, file, or subprocess.
pp(*objs)
Public Class Method
prints arguments in pretty form.
pp returns argument(s).
open_uri_original_open(*args)
Private Class Method
Alias for: open