Created
October 20, 2015 13:46
-
-
Save BrianDunlap89/91dcd2c2b4b69f8c3425 to your computer and use it in GitHub Desktop.
Week 5 Quiz - Brian Dunlap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Section 1 | |
| 1. You can infer that there are at least two models, and that of the two, Student objects will have many assignments. This association will allow users to access individual assignments using the syntax student.assignments(method). It also implies that the assignments table has a student_id column. | |
| Section 2 | |
| 1. (a) Four major parts of a request: a verb, a route, headers, and parameters(?). | |
| (b) Three major parts of a response: status code, a body, and headers | |
| 2. | |
| 3. PUT/PATCH are more aligned with updated or revising existing information, whereas POST creates a new entry/information altogether. | |
| Section 3 | |
| 1. The output for rickard.missing_hws would be 2. | |
| 2. 'self' refers to an instance of an object of the class. | |
| 3. They're being called on the class Student. attr_readers could be re-written as | |
| def name | |
| @name | |
| end | |
| def height | |
| @height | |
| end | |
| and attr_accessor could be | |
| def missing_hws(missing_hws) | |
| @missing_hws = missing_hws | |
| end | |
| AND | |
| def missing_hws | |
| @missing_hws | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment