__method__

__method__ â symbol__callee__ â symbol Instance Public methods Returns the name of the current method as a Symbol. If called outside of a method, it returns nil.

`

`cmd` â string Instance Public methods Returns the standard output of running cmd in a subshell. The built-in syntax %x{...} uses this method. Sets $? to the process status. `date` #=> "Wed Apr 9 08:56:30 CDT 2003\n" `ls testdir`.split[1] #=> "main.rb" `echo oops && exit 99` #=> "oops\n" $?.exitstatus #=> 99

abort

abortKernel::abort([msg])Process::abort([msg]) Instance Public methods Terminate execution immediately, effectively by calling Kernel.exit(false). If msg is given, it is written to STDERR prior to terminating.

at_exit

at_exit { block } â proc Instance Public methods 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 produces: goodbye cruel world

autoload

autoload(module, filename) â nil Instance Public methods Registers filename to be loaded (using Kernel::require) the first time that module (which may be a String or a symbol) is accessed. autoload(:MyModule, "/usr/local/lib/modules/my_module.rb")

autoload?

autoload?(name) â String or nil Instance Public methods Returns filename to be loaded if name is registered as autoload. autoload(:B, "b") autoload?(:B) #=> "b"

binding

binding â a_binding Instance Public methods Returns a Binding object, describing the variable and method bindings at the point of call. This object can be used when calling eval to execute the evaluated command in this environment. See also the description of class Binding. def get_binding(param) return binding end b = get_binding("hello") eval("param", b) #=> "hello"

block_given?

block_given? â true or false Instance Public methods Returns true if yield would execute a block in the current context. The iterator? form is mildly deprecated. def try if block_given? yield else "no block" end end try #=> "no block" try { "hello" } #=> "hello" try do "hello" end #=> "hello"

callcc

callcc {|cont| block } â obj Instance Public methods Generates a Continuation object, which it passes to the associated block. You need to require 'continuation' before using this method. Performing a cont.call will cause the callcc to return (as will falling through the end of the block). The value returned by the callcc is the value of the block, or the value passed to cont.call. See class Continuation for more details. Also see #throw for an alternative mechanism for unwindi

caller

caller(start=1, length=nil) â array or nilcaller(range) â array or nil Instance Public methods Returns the current execution stackâan array containing strings in the form file:line or file:line: in `method'. 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. Returns nil if start is greater than the size of