-
When would you think to create your own class?
-
What's the difference between a class and an instance of a class?
-
If you had an object called instructor and you wanted to find its name, what code should you probably write?
-
What is the functional difference between a varible named hometown and a variable named @hometown?
-
Assume you have a class named Car, with attributes of make, model and year. Write some code to create an instance of that class named new_car, then set the make of new_car to "Toyota"
-
If the attr_accessor line of the following class were commented out, what code could you write to achieve the same functionality?
class Student attr_acessor :name end
- Assume you want to create a Class of student that has a default attribute of course that is set to 'web development'. What is wrong with the following code?
class Student @course = 'web development'
def list_course
return @course
end
end
- What's the difference between a class level method and an instance level method