Skip to content

Instantly share code, notes, and snippets.

@mitchellh
Created September 18, 2010 06:30
Show Gist options
  • Save mitchellh/585425 to your computer and use it in GitHub Desktop.
Save mitchellh/585425 to your computer and use it in GitHub Desktop.
module UW
# Represents a course within a curriculum at UW. An example
# of a course is "CSE 142: Introduction to Programming."
#
# ## Attributes
#
# - year
# - quarter
# - curriculum_abbreviation
# - number
# - title
# - title_long
#
# ## Search Keys
#
# - year
# - quarter
# - curriculum_abbreviation
# - course_number
# - course_title_starts
# - course_title_contains
#
# You may also pass a {Curriculum} object in as `curriculum` to
# populate the proper fields.
class Course < Microformat
VALID_SEARCH_KEYS = [:year, :quarter, :curriculum_abbreviation, :course_number, :course_title_starts, :course_title_contains]
attribute :year
attribute :quarter
attribute :curriculum_abbreviation
scope :prefix => :course do
attribute :number
attribute :title
attribute :title_long
end
scope :group => :extended do
scope :prefix => :course do
attribute :description
attribute :comment
attribute :campus
attribute :college
end
attribute :credit_control
attribute :minimum_term_credit
attribute :maximum_term_credit
attribute :maximum_credit
attribute :grading_system
end
def self.find(options=nil)
find_helper("/public/course", VALID_SEARCH_KEYS, options)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment