Skip to content

Instantly share code, notes, and snippets.

@adamcooper
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamcooper/8856415 to your computer and use it in GitHub Desktop.
Save adamcooper/8856415 to your computer and use it in GitHub Desktop.
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
class Person
attr_accessor :name, :age
def initialize(params = {}); end
end
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
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