Last active
August 29, 2015 13:56
-
-
Save adamcooper/8856415 to your computer and use it in GitHub Desktop.
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
class Course | |
attr_accessor :title, :location | |
def initialize(params = {}); end | |
def add_teacher(teacher); end | |
def add_student(student); end | |
def for_each_student; end | |
private | |
attr_accessor :teachers, :students | |
end |
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
class Person | |
attr_accessor :name, :age | |
def initialize(params = {}); end | |
end |
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
class Student < Person | |
protected | |
attr_accessor :gpa | |
def initialize(params = {}); end | |
def add_course(course); end | |
def complete_course(course, gpa); end | |
private | |
attr_accessor :courses, :grades | |
def calculate_gpa; end | |
end |
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
class Teacher < Person | |
attr_accessor :description | |
def initialize(params={}); end | |
def add_course(course); end | |
private | |
attr_accessor :courses | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment