w4 d1-2 notes Flashcards

1
Q

What is the difference between execute and execute2 in a SQLite3 connection?

A

In execute2, the first column is an array with the column names.

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

Why does the scope change in define_method? Why does it change?

A

It changes to the scope of the instance, b/c it is the same as ‘def function_name’

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

What is the difference between include and extend?

A

Both are for modules, except include will make the methods instance methods and extend will make the methods class methods. For this reason, methods in modules should never be qualified with ‘self’ in their names, even if they are intended as class methods.

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

What is the path of a URL?

A

Everything after the domain name.

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

What does the Rails router do?

A

Makes a decision based on the verb and the path.

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

What is the lifecycle of a controller instance?

A

It is instatiated when called by the router, and destroyed at the end of the call, but not before building a response and sending it back.

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

What are paths abstractions of?

A

The file system of the server.

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