Definitions of keywords Flashcards

Learn the keywords to perform the action described by the definition

1
Q

Run this block when the script starts

A

BEGIN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Run this block when the script is done

A

END

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

create another name for a function

A

alias

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Logical and, but lower priority than &&

A

and

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Start a block, usually for exceptions

A

begin

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

break out of a loop right now

A

break

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Case style conditional, like an if

A

case

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Define a new class

A

class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

define a new function

A

def

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Is this class/function/etc. defined already?

A

defined?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Create a block that maybe takes a parameter

A

do

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Else conditional

A

else

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Else if conditional

A

elsif

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Ends blocks, functions, classes, everything

A

end

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Run this code whether an exception happens or not

A

ensure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Run this code whether an exception happens or not

17
Q

For loop syntax. The .each syntax is preferred

18
Q

If conditional

19
Q

In part of for-loops

20
Q

Define a new module

21
Q

skip to the next element of a .each iterator

22
Q

logical not. But use ! instead

23
Q

Logical or.

24
Q

Rerun a code block exactly the same

25
Run this code if an exception happens
rescue
26
In a rescue clause, says to try the block again
retry
27
Returns a value from a function
return
28
The current object, class, module
self
29
The parent of this class
super
30
Can be used with if optionally
then
31
Remove a function definition from a class
undef
32
Inverse of if
unless
33
Inverse of while, execute block as long as false
until
34
Part of case conditionals
when
35
while loop
while
36
Pause and transfer control to the code block
yield