Class: Verso::CourseList

Inherits:
Base
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable, HTTPGettable
Defined in:
lib/verso/course_list.rb

Overview

Search Verso courses by :text, :cluster, :program_area, :code, :edition, or any combination and get back an Array-like collection of Course objects.

Examples:

Search by text

courses = Verso::CourseList.new(:text => "golf") # => <Verso::CourseList:0x007fa5a10bbb68 @attrs={:text=>"golf"}>
courses.first.title # => "Turf Grass Applications, Advanced"

Search by cluster

course = Verso::CourseList.new(:cluster => "Information Technology).first
course.title # => "Computer Applications"

Search by program area

course = Verso::CourseList.new(:program_area => "Career Connections").last
course.title # => "Career Investigation Phase I"

Search by code

courses = Verso::CourseList.new(:code => "6320") # => <Verso::CourseList:0x007fa5a1f27a08 @attrs={:code=>"6320"}>
courses.first # => <Verso::Course:0x007fa5a1f3e5c8 @attrs={:duration=>36, :edition=>"2012", :code=>"6320" . . . }>
courses.first.code # => "6320"

Search by edition

all_2012 = Verso::CourseList.new(:edition => "2012")

Search by combination

courses = Verso::CourseList.new(:text => "internet", :cluster => "Marketing") # => <Verso::CourseList:0x007fa5a19b6c90 @attrs={ . . . }>
courses.count # => 1

Calling #new with no attrs

courses = Verso::CourseList.new
courses.count # => A big number
courses # => All the courses

Options Hash (attrs):

  • :code (String)

    Course code

  • :edition (String)

    Edition year

  • :text (String)

    Free text

  • :cluster (String)

    Cluster title

  • :program_area (String)

    Program Area title

See Also:

Instance Attribute Summary

Attributes inherited from Base

#attrs

Method Summary

Methods inherited from Base

attr_reader, #initialize

Constructor Details

This class inherits a constructor from Verso::Base