Skip to content

Instantly share code, notes, and snippets.

@BrianDunlap89
Created October 20, 2015 13:46
Show Gist options
  • Select an option

  • Save BrianDunlap89/91dcd2c2b4b69f8c3425 to your computer and use it in GitHub Desktop.

Select an option

Save BrianDunlap89/91dcd2c2b4b69f8c3425 to your computer and use it in GitHub Desktop.
Week 5 Quiz - Brian Dunlap
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