app/controllers/courses_controller.rb
# preparation for displaying lecture schedule 
# output @lecture_schedules, @extra_schedules; the entities are lecture.
preparation for displaying lecture schedule
output @lecture_schedules, @extra_schedules; the entities are lecture.
preparation for displaying lecture schedule output @lecture_schedules @extra_schedules ; the entities are lecture .
def to_lecture_schedules(lectures)    
    @lecture_schedules = []
    Lecture_Time_Range.each do |lt|
      week_sum = [lt]
      Wday_Range.to_a.each do |wday|
        contents = lectures.select do |c|
          c.lecture_time.to_i == lt && c.day_of_week.to_i == wday
        end
        week_sum << contents
        lectures -= contents
      end
      @lecture_schedules << week_sum
    end
    @extra_schedules = lectures
  end
def to_lecture_schedules ( lectures ) @lecture_schedules = [ ] Lecture_Time_Range . each do | lt | week_sum = [ lt ] Wday_Range . to_a . each do | wday | contents = lectures . select do | c | c . lecture_time . to_i == lt && c . day_of_week . to_i == wday end week_sum << contents lectures -= contents end @lecture_schedules << week_sum end @extra_schedules = lectures end
preparation for displaying lecture schedule
output @lecture_schedules, @extra_schedules; the entities are lecture.
preparation for displaying lecture schedule output @lecture_schedules @extra_schedules ; the entities are lecture .
# courses which are out of specified schedule ranges.
lectures
<not_specific>