Class: Martlet::Record

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Record

Returns a new instance of Record.



5
6
7
8
9
10
11
12
# File 'lib/martlet/record.rb', line 5

def initialize(args)
  @number  = args[:number]
  @name    = args[:name]
  @section = args[:section]
  @credits = args[:credits].to_i
  @grade   = args[:grade]
  @average = args[:average]
end

Instance Attribute Details

#averageObject

Returns the value of attribute average.



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

def average
  @average
end

#creditsObject

Returns the value of attribute credits.



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

def credits
  @credits
end

#gradeObject

Returns the value of attribute grade.



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

def grade
  @grade
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#numberObject

Returns the value of attribute number.



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

def number
  @number
end

#sectionObject

Returns the value of attribute section.



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

def section
  @section
end

Instance Method Details

#average_gpaObject



18
19
20
# File 'lib/martlet/record.rb', line 18

def average_gpa
  grade_to_gpa(average)
end

#gpaObject



14
15
16
# File 'lib/martlet/record.rb', line 14

def gpa
  grade_to_gpa(grade)
end