diff --git a/lib/endpoints.rb b/lib/endpoints.rb index 1242b27..349e15a 100644 --- a/lib/endpoints.rb +++ b/lib/endpoints.rb @@ -51,7 +51,7 @@ def getUrl(url) # @param parameters [Hash] # @return [Object] def get(id, includes = Hash.new(), parameters = Hash.new()) - unless includes.nil? or includes.empty? + unless includes.nil? || includes.empty? parameters['include'] = includes.join(",") end unless parameters.empty? @@ -129,11 +129,11 @@ def delete(body=Hash.new()) end def all(includes = Array.new(), parameters = Hash.new()) - unless includes.nil? or includes.empty? + unless includes.nil? || includes.empty? parameters['include'] = includes.join(",") end - unless parameters.nil? or parameters.empty? + unless parameters.nil? || parameters.empty? uriparams = Addressable::URI.new uriparams.query_values = parameters uriparams.query diff --git a/lib/writeback/sessionattendancerecord.rb b/lib/writeback/sessionattendancerecord.rb index 254a1d7..ab6f12d 100644 --- a/lib/writeback/sessionattendancerecord.rb +++ b/lib/writeback/sessionattendancerecord.rb @@ -6,7 +6,7 @@ class SessionAttendanceRecord #most of these methods are here to be compatible 1:1 with the php module, standard ruby getters and setters should still work too def setStudentId(studentId) - if studentId.empty? or studentId.nil? + if studentId.nil? || studentId.empty? throw InvalidAttendanceException, 'Student id can not be set to null.' end @student_id = studentId @@ -14,14 +14,14 @@ def setStudentId(studentId) def setAttendanceCodeId(attendanceCodeId) - if attendanceCodeId.empty? or attendanceCodeId.nil? + if attendanceCodeId.nil? || attendanceCodeId.empty? throw InvalidAttendanceException, 'Attendance code id can not be set to null.' end @attendance_code_id = attendanceCodeId end def setDate(date) - if date.empty? or date.nil? + if date.nil? || date.empty? throw InvalidAttendanceException, 'Date can not be set to null.' end begin @@ -72,7 +72,7 @@ def toArray() 'student_id': self.getStudentId(), 'attendance_code_id': self.getAttendanceCodeId() } - unless self.getComment.nil? or self.getComment.empty? + unless self.getComment.nil? || self.getComment.empty? required['comment'] = self.getComment() end return required