Class: Wonde::LessonAttendanceRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/writeback/lessonattendancerecord.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attendance_code_idObject

Returns the value of attribute attendance_code_id.



3
4
5
# File 'lib/writeback/lessonattendancerecord.rb', line 3

def attendance_code_id
  @attendance_code_id
end

#lesson_idObject

Returns the value of attribute lesson_id.



3
4
5
# File 'lib/writeback/lessonattendancerecord.rb', line 3

def lesson_id
  @lesson_id
end

#student_idObject

Returns the value of attribute student_id.



3
4
5
# File 'lib/writeback/lessonattendancerecord.rb', line 3

def student_id
  @student_id
end

Instance Method Details

#getAttendanceCodeIdObject



40
41
42
# File 'lib/writeback/lessonattendancerecord.rb', line 40

def getAttendanceCodeId()
    return self.attendance_code_id
end

#getLessonIdObject



36
37
38
# File 'lib/writeback/lessonattendancerecord.rb', line 36

def getLessonId()
    return self.lesson_id
end

#getStudentIdObject



32
33
34
# File 'lib/writeback/lessonattendancerecord.rb', line 32

def getStudentId()
    return self.student_id
end

#isValidObject



28
29
30
# File 'lib/writeback/lessonattendancerecord.rb', line 28

def isValid()
  return ! (self.getStudentId().empty? || self.getLessonId().empty? || self.getAttendanceCodeId().empty?)
end

#setAttendanceCodeId(attendanceCodeId) ⇒ Object



21
22
23
24
25
26
# File 'lib/writeback/lessonattendancerecord.rb', line 21

def setAttendanceCodeId(attendanceCodeId)
  if attendanceCodeId.empty? or attendanceCodeId.nil?
      throw InvalidLessonAttendanceException, 'Attendance code id can not be set to null.'
  end
  @attendance_code_id = attendanceCodeId
end

#setLessonId(lessonId) ⇒ Object



14
15
16
17
18
19
# File 'lib/writeback/lessonattendancerecord.rb', line 14

def setLessonId(lessonId)
  if lessonId.empty? or lessonId.nil?
      throw InvalidLessonAttendanceException, 'Lesson id can not be set to null.'
  end
  @lesson_id = lessonId
end

#setStudentId(studentId) ⇒ Object

most of these methods are here to be compatible 1:1 with the php module, standard ruby getters and setters should still work too



7
8
9
10
11
12
# File 'lib/writeback/lessonattendancerecord.rb', line 7

def setStudentId(studentId)
    if studentId.empty? or studentId.nil?
        throw InvalidLessonAttendanceException, 'Student id can not be set to null.'
    end
    @student_id = studentId
end

#toArrayObject



44
45
46
47
48
49
50
51
# File 'lib/writeback/lessonattendancerecord.rb', line 44

def toArray()
    required = {
        'lesson_id':          self.getLessonId(),
        'student_id':         self.getStudentId(),
        'attendance_code_id': self.getAttendanceCodeId()
    }
    return required
end