Ruby Terms Flashcards

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

Checks the array for specific value and returns “true” or “false” if value is found.

A

.include?

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

Add input (to the end) of an array.

A

.push

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

deletes the last item in array

A

.pop

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

takes array series and makes one

A

.flatten

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

makes every value/word/string it’s own array item

A

.split

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

runs a block once over each item

A

.each

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

runs a block once over each item and changes the original

A

.map

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

check to see if there’s an assigned key within a block

A

.has_key?

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

return the key/value pair

A

.select

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

shortcut to return only the value, passing on the key

A

.fetch

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

converts a hash to an array

A

.to_a

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