Symbol review Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

\

A

Escape backslash

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

'

A

Escape single-quote (‘)

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

"

A

Escape double-quote (“)

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

\a

A

Escape bell

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

\b

A

Escape backspace

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

\f

A

Escape formfeed

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

\n

A

Escape newline

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

\r

A

Escape carriage

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

\t

A

Escape Tab (TAB)

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

\v

A

Escape vertical tab

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

BEGIN

A

Run this block when the script starts.

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

END

A

Run this block when the script is done.

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

alias

A

Create another name for a function.

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

and

A

Logical and, but lower priority than &&.

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

begin

A

Start a block, usually for exceptions.

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

break

A

Break out of a loop.

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

case

A

Case style conditional, like an if.

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

class

A

Define a new class.

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

def

A

Define a new function.

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

defined?

A

Is this class/function/etc. defined already?

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

do

A

Create a block that maybe takes a parameter.

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

else

A

Else conditional.

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

elsif

A

Else if conditional

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

end

A

Ends blocks, functions, classes, etc.

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

ensure

A

Run this code whether an exception happens or not.

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

for

A

For loop syntax. *The .each syntax is preferred.

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

if

A

If conditional.

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

in

A

In part of for-loops.

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

module

A

Define a new module.

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

next

A

Skip to the next element of a .each iterator.

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

not

A

Logical not. *use ! instead.

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

or

A

Logical or.

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

redo

A

Rerun a code block exactly the same.

34
Q

rescue

A

Run this code if an exception happens.

35
Q

retry

A

In a rescue clause, says to try the block again.

36
Q

return

A

Returns a value from a function. *Mostly optional.

37
Q

self

A

The current object, class, or module.

38
Q

super

A

The parent class of this class.

39
Q

then

A

Can be used with if optionally.

40
Q

undef

A

Remove a function definition from a class.

41
Q

unless

A

Inverse of if.

42
Q

until

A

Inverse of while, execute block as long as false.

43
Q

when

A

Part of case conditionals.

44
Q

while

A

While loop.

45
Q

yield

A

Pause and transfer control to the code block.

46
Q

true

A

True boolean value.

47
Q

false

A

False boolean value.

48
Q

nil

A

Represents “nothing” or “no value”.

49
Q

strings

A

Stores textual information.

50
Q

numbers

A

Stores integers.

51
Q

floats

A

Stores decimals.

52
Q

arrays

A

Stores a list of things.

53
Q

hashes

A

Stores a key=value mapping of things.

54
Q

+

A

Add

55
Q

-

A

Subtract

56
Q

*

A

Multiply

57
Q

**

A

Power of

58
Q

/

A

Divide

59
Q

%

A

Modulus

60
Q

>

A

Greater then

61
Q

.

A

Dot access

62
Q

::

A

colon access

63
Q

[ ]

A

List brackets

64
Q

!

A

Not

65
Q

<

A

Less then

66
Q

> =

A

Greater then equal

67
Q

<=

A

Less then equal

68
Q

==

A

Comparison

69
Q

===

A

Equality

70
Q

!=

A

Not equal

71
Q

&&

A

Logical and (higher precedence)

72
Q

||

A

Logical or (higher precedence)

73
Q

..

A

Range inclusive

74
Q

A

Range non-inclusive

75
Q

@

A

Object scope

76
Q

@@

A

Class scope

77
Q

$

A

Global scope

78
Q

What does a||b do?

A

Check if a is either false or nill, if it is return b. Otherwise return a

79
Q

What will this return if count is nill?

count ||= 37

A

count = 37

80
Q

What will this return if count is 21?

count ||= 37

A

count = 21