Tutor profile: Avery W.
Subject: Web Development
Explain what REST means.
REST, or REpresentational State Transfer is a set of standards to improve communication between machines using the web. There must be a separation between client and server. The communication must be stateless, meaning the client doesn't need to know anything about the state of the server and vice versa. Communication is made using requests using HTTP verbs, a header, a path and optional data. Servers will respond with an HTTP code confirming the request and notifying the client of the success or failure.
Subject: Ruby Programming
Give an example of metaprogramming in ruby.
Method missing is a method in ruby in which you may define dynamic methods which may meet specific requirements without being explicitly defined. For example, assume a Person class has an attribute of `pet` which could any type of Animal class. class Person attr_accessor :pet def method_missing(method, *args, &block) if pet.respond_to? method pet.send method else super end end class Dog < Animal attr_accessor :name end dog = Dog.new name: 'Rufus' person = Person.new pet: dog person.pet_name #=> 'Rufus'
Find the linear function f(x) = A x + B such that f(3) = -11 and f(7) = -19
y = -2x - 5
needs and Avery will reply soon.