Definitions of keywords Flashcards

Learn the keywords to perform the action described by the definition

You may prefer our related Brainscape-certified flashcards:
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

A

ensure

17
Q

For loop syntax. The .each syntax is preferred

A

for

18
Q

If conditional

A

if

19
Q

In part of for-loops

A

in

20
Q

Define a new module

A

module

21
Q

skip to the next element of a .each iterator

A

next

22
Q

logical not. But use ! instead

A

not

23
Q

Logical or.

A

or

24
Q

Rerun a code block exactly the same

A

redo

25
Q

Run this code if an exception happens

A

rescue

26
Q

In a rescue clause, says to try the block again

A

retry

27
Q

Returns a value from a function

A

return

28
Q

The current object, class, module

A

self

29
Q

The parent of this class

A

super

30
Q

Can be used with if optionally

A

then

31
Q

Remove a function definition from a class

A

undef

32
Q

Inverse of if

A

unless

33
Q

Inverse of while, execute block as long as false

A

until

34
Q

Part of case conditionals

A

when

35
Q

while loop

A

while

36
Q

Pause and transfer control to the code block

A

yield