Definitions of keywords Flashcards
Learn the keywords to perform the action described by the definition
Run this block when the script starts
BEGIN
Run this block when the script is done
END
create another name for a function
alias
Logical and, but lower priority than &&
and
Start a block, usually for exceptions
begin
break out of a loop right now
break
Case style conditional, like an if
case
Define a new class
class
define a new function
def
Is this class/function/etc. defined already?
defined?
Create a block that maybe takes a parameter
do
Else conditional
else
Else if conditional
elsif
Ends blocks, functions, classes, everything
end
Run this code whether an exception happens or not
ensure
Run this code whether an exception happens or not
ensure
For loop syntax. The .each syntax is preferred
for
If conditional
if
In part of for-loops
in
Define a new module
module
skip to the next element of a .each iterator
next
logical not. But use ! instead
not
Logical or.
or
Rerun a code block exactly the same
redo
Run this code if an exception happens
rescue
In a rescue clause, says to try the block again
retry
Returns a value from a function
return
The current object, class, module
self
The parent of this class
super
Can be used with if optionally
then
Remove a function definition from a class
undef
Inverse of if
unless
Inverse of while, execute block as long as false
until
Part of case conditionals
when
while loop
while
Pause and transfer control to the code block
yield