Symbol review Flashcards

(80 cards)

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
ensure
Run this code whether an exception happens or not.
26
for
For loop syntax. *The .each syntax is preferred.
27
if
If conditional.
28
in
In part of for-loops.
29
module
Define a new module.
30
next
Skip to the next element of a .each iterator.
31
not
Logical not. *use ! instead.
32
or
Logical or.
33
redo
Rerun a code block exactly the same.
34
rescue
Run this code if an exception happens.
35
retry
In a rescue clause, says to try the block again.
36
return
Returns a value from a function. *Mostly optional.
37
self
The current object, class, or module.
38
super
The parent class of this class.
39
then
Can be used with if optionally.
40
undef
Remove a function definition from a class.
41
unless
Inverse of if.
42
until
Inverse of while, execute block as long as false.
43
when
Part of case conditionals.
44
while
While loop.
45
yield
Pause and transfer control to the code block.
46
true
True boolean value.
47
false
False boolean value.
48
nil
Represents "nothing" or "no value".
49
strings
Stores textual information.
50
numbers
Stores integers.
51
floats
Stores decimals.
52
arrays
Stores a list of things.
53
hashes
Stores a key=value mapping of things.
54
+
Add
55
-
Subtract
56
*
Multiply
57
**
Power of
58
/
Divide
59
%
Modulus
60
>
Greater then
61
.
Dot access
62
::
colon access
63
[ ]
List brackets
64
!
Not
65
<
Less then
66
>=
Greater then equal
67
<=
Less then equal
68
==
Comparison
69
===
Equality
70
!=
Not equal
71
&&
Logical and (higher precedence)
72
||
Logical or (higher precedence)
73
..
Range inclusive
74
...
Range non-inclusive
75
@
Object scope
76
@@
Class scope
77
$
Global scope
78
What does a||b do?
Check if a is either false or nill, if it is return b. Otherwise return a
79
What will this return if count is nill? | count ||= 37
count = 37
80
What will this return if count is 21? | count ||= 37
count = 21