Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/endpoints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/writeback/sessionattendancerecord.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ 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
end


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
Expand Down Expand Up @@ -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
Expand Down