Object Methods

Lesson 31
Author : Afrixi
Last Updated : November, 2017


Table of Content

Code

Copyclass Student
     attr_accessor :name, :major, :gpa
     def initialize(name, major, gpa)
          @name = title
          @major = author
          @gpa = gpa
     end

     def has_honors()
          if self.gpa >= 3.5
               return true
          end
          return false
     end
end