Class: Martlet::Course
- Inherits:
-
Object
- Object
- Martlet::Course
- Defined in:
- lib/martlet/course.rb
Instance Attribute Summary collapse
-
#campus ⇒ Object
Returns the value of attribute campus.
-
#credits ⇒ Object
Returns the value of attribute credits.
-
#crn ⇒ Object
Returns the value of attribute crn.
-
#instructor ⇒ Object
Returns the value of attribute instructor.
-
#level ⇒ Object
Returns the value of attribute level.
-
#meetings ⇒ Object
Returns the value of attribute meetings.
-
#name ⇒ Object
Returns the value of attribute name.
-
#number ⇒ Object
Returns the value of attribute number.
-
#term ⇒ Object
Returns the value of attribute term.
Instance Method Summary collapse
-
#initialize(args) ⇒ Course
constructor
A new instance of Course.
- #location ⇒ Object
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
#campus ⇒ Object
Returns the value of attribute campus.
3 4 5 |
# File 'lib/martlet/course.rb', line 3 def campus @campus end |
#credits ⇒ Object
Returns the value of attribute credits.
3 4 5 |
# File 'lib/martlet/course.rb', line 3 def credits @credits end |
#crn ⇒ Object
Returns the value of attribute crn.
3 4 5 |
# File 'lib/martlet/course.rb', line 3 def crn @crn end |
#instructor ⇒ Object
Returns the value of attribute instructor.
3 4 5 |
# File 'lib/martlet/course.rb', line 3 def instructor @instructor end |
#level ⇒ Object
Returns the value of attribute level.
3 4 5 |
# File 'lib/martlet/course.rb', line 3 def level @level end |
#meetings ⇒ Object
Returns the value of attribute meetings.
3 4 5 |
# File 'lib/martlet/course.rb', line 3 def meetings @meetings end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/martlet/course.rb', line 3 def name @name end |
#number ⇒ Object
Returns the value of attribute number.
3 4 5 |
# File 'lib/martlet/course.rb', line 3 def number @number end |
#term ⇒ Object
Returns the value of attribute term.
3 4 5 |
# File 'lib/martlet/course.rb', line 3 def term @term end |
Instance Method Details
#location ⇒ Object
19 20 21 |
# File 'lib/martlet/course.rb', line 19 def location meetings.first.location end |