w4d1 Flashcards

1
Q

What’s a good key for errors in a validation?

A

the name of the column

better yet:

:column_name_id

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

What does instance_variable_get do?

and instance_variable_set

A

Gets/sets an instance variable without using a getter

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

What does send do?

A

It takes in a symbol/string that corresponds to an instance variable and invokes that method

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

How do you call define method from outside of the containing class?

A

SomeClass.send(:define_method, :method_name, &prc)

Where prc is the block you’d normally pass to define_method

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

What do you always have to do if you overwrite method_missing?

A

call super if our conditions aren’t satisfied

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

What 6 methods are key to metaprogramming?

A
#send
#define_method
#method_missing
#instance_variable_get
#instance_variable_set
#methods
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you see routes?

A

rails routes

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

What are the RESTful methods?

A
index
create
update
show
destroy
How well did you know this?
1
Not at all
2
3
4
5
Perfectly