caller_locations

caller_locations(start=1, length=nil) â array or nilcaller_locations(range) â array or nil Instance Public methods Returns the current execution stackâan array containing backtrace location objects. See Thread::Backtrace::Location for more information. The optional start parameter determines the number of initial stack entries to omit from the top of the stack. A second optional length parameter can be used to limit how many entries are returned from the stack.

catch

catch([arg]) {|tag| block } â obj Instance Public methods catch executes its block. If a throw is executed, Ruby searches up its stack for a catch block with a tag corresponding to the throw's tag. If found, that block is terminated, and catch returns the value given to throw. If throw is not called, the block terminates normally, and the value of catch is the value of the last expression evaluated. catch expressions may be nested, and the throw call need not be in lexical scope.

chomp

chomp â $_chomp(string) â $_ Instance Public methods Equivalent to $_ = $_.chomp(string). See String#chomp. Available only when -p/-n command line option specified.

chop

chop â string Instance Public methods Equivalent to ($_.dup).chop!, except nil is never returned. See String#chop!. Available only when -p/-n command line option specified.

eval

eval(string [, binding [, filename [,lineno]]]) â obj Instance Public methods Evaluates the Ruby expression(s) in string. If binding is given, which must be a Binding object, the evaluation is performed in its context. If the optional filename and lineno parameters are present, they will be used when reporting syntax errors. def get_binding(str) return binding end str = "hello" eval "str + ' Fred'" #=> "hello Fred" eval "str + ' Fred'", get_binding("bye"

exec

exec([env,] command... [,options]) Instance Public methods Replaces the current process by running the given external command. command⦠is one of following forms. commandline : command line string which is passed to the standard shell cmdname, arg1, ... : command name and one or more arguments (no shell) [cmdname, argv0], arg1, ... : command name, argv[0] and zero or more arguments (no shell) If single string is given as the command, it is taken as a comm

exit

exit(status=true)Kernel::exit(status=true)Process::exit(status=true) Instance Public methods 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 "re

exit!

Process.exit!(status=false) Instance Public methods Exits the process immediately. No exit handlers are run. status is returned to the underlying system as the exit status. Process.exit!(true)

fail

failfail(string)fail(exception [, string [, array]]) Instance Public methods With no arguments, raises the exception in $! or raises a RuntimeError if $! is nil. With a single String argument, raises a RuntimeError with the string as a message. Otherwise, the first parameter should be the name of an Exception class (or an object that returns an Exception object when sent an exception message). The optional second parameter sets the message associated with the exception, and the thi

fork

Kernel.fork [{ block }] â fixnum or nilProcess.fork [{ block }] â fixnum or nil Instance Public methods Creates a subprocess. If a block is specified, that block is run in the subprocess, and the subprocess terminates with a status of zero. Otherwise, the fork call returns twice, once in the parent, returning the process ID of the child, and once in the child, returning nil. The child process can exit using Kernel.exit! to avoid running any at_exit functions. The parent proce