Symbols & Methods Flashcards

To learn the basics of Ruby symbols and function, so that I may read code

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

#

A

octothrope - used to make a comment

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

{$0}

A

From command line, the name of the script you are running

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

{variable}

A

used for interpolation of a variable / to include your variable that doesn’t have information in it yet

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

$

A

attaches a variable from the command line

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

%

A

Modulo that returns the remainder in division

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

%d

A

represents a digit in a text string

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

%s

A

represents a string of text in a test string

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

( )

A

used to encapsulate arguments

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

*

A

multiplication

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

+

A

addition

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

-

A

subtraction

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

/

A

division

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

<

A

less than

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

«TEXT TEXT

A

to start and end a chunk of code that will not be read by ruby

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

<=

A

less than or equal to

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

>

A

greater than

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

> =

A

greater than or equal to

18
Q

ARGV

A

argument value, holds arguments held on the cmd line

19
Q

File

A

used as a method to define and enact file options

20
Q

File.close()

A

closes a file

21
Q

File.exists?

A

check to see if a file exists or not

22
Q

File.open()

A

opens a file

23
Q

File.open(filename, ‘w’)

A

Specifically opens a file for writing

24
Q

File.read()

A

reads the contents of a file

25
Q

File.readline()

A

reads a numbered line on a file

26
Q

File.seek()

A

locate a particular spot in the file

27
Q

File.truncate()

A

remove the contents of a file

28
Q

File.write()

A

write line or characters to a file

29
Q

STDIN

A

used when ARGV is used to get input from the user

30
Q

[ ]

A

array

31
Q

\

A

permits on backslash

32
Q

\n

A

new line

33
Q

\t

A

adds tab space

34
Q

chomp

A

used w/gets to get info

35
Q

do

A

reflects the start of a block of code to be run together

36
Q

end

A

closes a block section of code

37
Q

gets

A

takes input

38
Q

open

A

open a file or url

39
Q

print

A

takes text and prints it on the screen

40
Q

puts

A

used to “put” a “string” of characters on the screen along with a new line

41
Q

variable

A

a value stored