Class: Martlet::Record
- Inherits:
-
Object
- Object
- Martlet::Record
- Defined in:
- lib/martlet/record.rb
Instance Attribute Summary collapse
-
#average ⇒ Object
Returns the value of attribute average.
-
#credits ⇒ Object
Returns the value of attribute credits.
-
#grade ⇒ Object
Returns the value of attribute grade.
-
#name ⇒ Object
Returns the value of attribute name.
-
#number ⇒ Object
Returns the value of attribute number.
-
#section ⇒ Object
Returns the value of attribute section.
Instance Method Summary collapse
- #average_gpa ⇒ Object
- #gpa ⇒ Object
-
#initialize(args) ⇒ Record
constructor
A new instance of Record.
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
#average ⇒ Object
Returns the value of attribute average.
3 4 5 |
# File 'lib/martlet/record.rb', line 3 def average @average end |
#credits ⇒ Object
Returns the value of attribute credits.
3 4 5 |
# File 'lib/martlet/record.rb', line 3 def credits @credits end |
#grade ⇒ Object
Returns the value of attribute grade.
3 4 5 |
# File 'lib/martlet/record.rb', line 3 def grade @grade end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/martlet/record.rb', line 3 def name @name end |
#number ⇒ Object
Returns the value of attribute number.
3 4 5 |
# File 'lib/martlet/record.rb', line 3 def number @number end |
#section ⇒ Object
Returns the value of attribute section.
3 4 5 |
# File 'lib/martlet/record.rb', line 3 def section @section end |
Instance Method Details
#average_gpa ⇒ Object
18 19 20 |
# File 'lib/martlet/record.rb', line 18 def average_gpa grade_to_gpa(average) end |
#gpa ⇒ Object
14 15 16 |
# File 'lib/martlet/record.rb', line 14 def gpa grade_to_gpa(grade) end |