Sha256: f36e9a04b1d55728ffccd22e05e31452c9f215a886685a6c87712cf7056b0624

Contents?: true

Size: 716 Bytes

Versions: 12

Compression:

Stored size: 716 Bytes

Contents

# frozen_string_literal: true

module Meibo
  class ClassroomSet < DataSet
    def check_semantically_consistent
      super

      each do |classroom|
        roster.organizations.find(classroom.school_sourced_id)
        roster.courses.find(classroom.course_sourced_id)

        raise DataNotFoundError, "termSourcedIdは1つ以上指定してください" if classroom.term_sourced_ids.empty?

        classroom.term_sourced_ids.each do |term_sourced_id|
          roster.academic_sessions.find(term_sourced_id)
        end
      end
    end

    def homeroom
      @cache[:homeroom] ||= new(select(&:homeroom?))
    end

    def scheduled
      @cache[:scheduled] ||= new(select(&:scheduled?))
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
meibo-0.25.3 lib/meibo/classroom_set.rb
meibo-0.25.2 lib/meibo/classroom_set.rb
meibo-0.25.1 lib/meibo/classroom_set.rb
meibo-0.25.0 lib/meibo/classroom_set.rb
meibo-0.24.0 lib/meibo/classroom_set.rb
meibo-0.23.0 lib/meibo/classroom_set.rb
meibo-0.22.0 lib/meibo/classroom_set.rb
meibo-0.21.0 lib/meibo/classroom_set.rb
meibo-0.20.0 lib/meibo/classroom_set.rb
meibo-0.19.0 lib/meibo/classroom_set.rb
meibo-0.18.0 lib/meibo/classroom_set.rb
meibo-0.17.0 lib/meibo/classroom_set.rb