[rubygems/rubygems] Use a constant empty tar header to avoid extra allocations
[ruby.git] / doc / keywords.rdoc
blob7c368205efabba088116294b9ea4b570c658092f
1 = Keywords
3 The following keywords are used by Ruby.
5 __ENCODING__::
6   The script encoding of the current file.  See Encoding.
8 __LINE__::
9   The line number of this keyword in the current file.
11 __FILE__::
12   The path to the current file.
14 BEGIN::
15   Runs before any other code in the current file.  See {miscellaneous
16   syntax}[rdoc-ref:syntax/miscellaneous.rdoc]
18 END::
19   Runs after any other code in the current file.  See {miscellaneous
20   syntax}[rdoc-ref:syntax/miscellaneous.rdoc]
22 alias::
23   Creates an alias between two methods (and other things).  See {modules and
24   classes syntax}[rdoc-ref:syntax/modules_and_classes.rdoc]
26 and::
27   Short-circuit Boolean and with lower precedence than <code>&&</code>
29 begin::
30   Starts an exception handling block.  See {exceptions
31   syntax}[rdoc-ref:syntax/exceptions.rdoc]
33 break::
34   Leaves a block early.  See {control expressions
35   syntax}[rdoc-ref:syntax/control_expressions.rdoc]
37 case::
38   Starts a +case+ expression.  See {control expressions
39   syntax}[rdoc-ref:syntax/control_expressions.rdoc]
41 class::
42   Creates or opens a class.  See {modules and classes
43   syntax}[rdoc-ref:syntax/modules_and_classes.rdoc]
45 def::
46   Defines a method.  See {methods syntax}[rdoc-ref:syntax/methods.rdoc]
48 defined?::
49   Returns a string describing its argument.  See {miscellaneous
50   syntax}[rdoc-ref:syntax/miscellaneous.rdoc]
52 do::
53   Starts a block.
55 else::
56   The unhandled condition in +case+, +if+ and +unless+ expressions.  See
57   {control expressions}[rdoc-ref:syntax/control_expressions.rdoc]
59 elsif::
60   An alternate condition for an +if+ expression.  See {control
61   expressions}[rdoc-ref:syntax/control_expressions.rdoc]
63 end::
64   The end of a syntax block.  Used by classes, modules, methods, exception
65   handling and control expressions.
67 ensure::
68   Starts a section of code that is always run when an exception is raised.
69   See {exception handling}[rdoc-ref:syntax/exceptions.rdoc]
71 false::
72   Boolean false.  See {literals}[rdoc-ref:syntax/literals.rdoc]
74 for::
75   A loop that is similar to using the +each+ method.  See {control
76   expressions}[rdoc-ref:syntax/control_expressions.rdoc]
78 if::
79   Used for +if+ and modifier +if+ statements.  See {control
80   expressions}[rdoc-ref:syntax/control_expressions.rdoc]
82 in::
83   Used to separate the iterable object and iterator variable in a +for+ loop.
84   See {control expressions}[rdoc-ref:syntax/control_expressions.rdoc]
85   It also serves as a pattern in a +case+ expression.
86   See {pattern matching}[rdoc-ref:syntax/pattern_matching.rdoc]
88 module::
89   Creates or opens a module.  See {modules and classes
90   syntax}[rdoc-ref:syntax/modules_and_classes.rdoc]
92 next::
93   Skips the rest of the block.  See {control
94   expressions}[rdoc-ref:syntax/control_expressions.rdoc]
96 nil::
97   A false value usually indicating "no value" or "unknown".  See
98   {literals}[rdoc-ref:syntax/literals.rdoc]
100 not::
101   Inverts the following boolean expression.  Has a lower precedence than
102   <code>!</code>
104 or::
105   Boolean or with lower precedence than <code>||</code>
107 redo::
108   Restarts execution in the current block.  See {control
109   expressions}[rdoc-ref:syntax/control_expressions.rdoc]
111 rescue::
112   Starts an exception section of code in a +begin+ block.  See {exception
113   handling}[rdoc-ref:syntax/exceptions.rdoc]
115 retry::
116   Retries an exception block.  See {exception
117   handling}[rdoc-ref:syntax/exceptions.rdoc]
119 return::
120   Exits a method.  See {methods}[rdoc-ref:syntax/methods.rdoc].
121   If met in top-level scope, immediately stops interpretation of
122   the current file.
124 self::
125   The object the current method is attached to.  See
126   {methods}[rdoc-ref:syntax/methods.rdoc]
128 super::
129   Calls the current method in a superclass.  See
130   {methods}[rdoc-ref:syntax/methods.rdoc]
132 then::
133   Indicates the end of conditional blocks in control structures.  See
134   {control expressions}[rdoc-ref:syntax/control_expressions.rdoc]
136 true::
137   Boolean true.  See {literals}[rdoc-ref:syntax/literals.rdoc]
139 undef::
140   Prevents a class or module from responding to a method call.
141   See {modules and classes}[rdoc-ref:syntax/modules_and_classes.rdoc]
143 unless::
144   Used for +unless+ and modifier +unless+ statements.  See {control
145   expressions}[rdoc-ref:syntax/control_expressions.rdoc]
147 until::
148   Creates a loop that executes until the condition is true.  See
149   {control expressions}[rdoc-ref:syntax/control_expressions.rdoc]
151 when::
152   A condition in a +case+ expression.  See
153   {control expressions}[rdoc-ref:syntax/control_expressions.rdoc]
155 while::
156   Creates a loop that executes while the condition is true.  See
157   {control expressions}[rdoc-ref:syntax/control_expressions.rdoc]
159 yield::
160   Starts execution of the block sent to the current method.  See
161   {methods}[rdoc-ref:syntax/methods.rdoc]