Class: Martlet::Course

Inherits:
Object
  • Object
show all
Defined in:
lib/martlet/course.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Course

Returns a new instance of Course.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/martlet/course.rb', line 5

def initialize(args)
  @name        = args[:name] || ''
  @number      = args[:number]
  @term        = args[:term]
  @crn         = args[:crn]
  @instructor  = args[:instructor]
  @credits     = args[:credits]
  @level       = args[:level]
  @campus      = args[:campus]
  @meetings    = args[:meetings]

  @name.gsub! /\.$/, ''
end

Instance Attribute Details

#campusObject

Returns the value of attribute campus.



3
4
5
# File 'lib/martlet/course.rb', line 3

def campus
  @campus
end

#creditsObject

Returns the value of attribute credits.



3
4
5
# File 'lib/martlet/course.rb', line 3

def credits
  @credits
end

#crnObject

Returns the value of attribute crn.



3
4
5
# File 'lib/martlet/course.rb', line 3

def crn
  @crn
end

#instructorObject

Returns the value of attribute instructor.



3
4
5
# File 'lib/martlet/course.rb', line 3

def instructor
  @instructor
end

#levelObject

Returns the value of attribute level.



3
4
5
# File 'lib/martlet/course.rb', line 3

def level
  @level
end

#meetingsObject

Returns the value of attribute meetings.



3
4
5
# File 'lib/martlet/course.rb', line 3

def meetings
  @meetings
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/martlet/course.rb', line 3

def name
  @name
end

#numberObject

Returns the value of attribute number.



3
4
5
# File 'lib/martlet/course.rb', line 3

def number
  @number
end

#termObject

Returns the value of attribute term.



3
4
5
# File 'lib/martlet/course.rb', line 3

def term
  @term
end

Instance Method Details

#locationObject



19
20
21
# File 'lib/martlet/course.rb', line 19

def location
  meetings.first.location
end