Sha256: 7446411481dde65758efe6c34a75dcc33c31507c216b22a3f16fd0c17dc79f41

Contents?: true

Size: 679 Bytes

Versions: 16

Compression:

Stored size: 679 Bytes

Contents

# frozen_string_literal: true

module Meibo
  class EnrollmentSet < DataSet
    def check_semantically_consistent
      super

      each do |enrollment|
        roster.classes.find(enrollment.class_sourced_id)
        roster.organizations.find(enrollment.school_sourced_id)
        roster.users.find(enrollment.user_sourced_id)
      end
    end

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

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

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

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
meibo-0.25.3 lib/meibo/enrollment_set.rb
meibo-0.25.2 lib/meibo/enrollment_set.rb
meibo-0.25.1 lib/meibo/enrollment_set.rb
meibo-0.25.0 lib/meibo/enrollment_set.rb
meibo-0.24.0 lib/meibo/enrollment_set.rb
meibo-0.23.0 lib/meibo/enrollment_set.rb
meibo-0.22.0 lib/meibo/enrollment_set.rb
meibo-0.21.0 lib/meibo/enrollment_set.rb
meibo-0.20.0 lib/meibo/enrollment_set.rb
meibo-0.19.0 lib/meibo/enrollment_set.rb
meibo-0.18.0 lib/meibo/enrollment_set.rb
meibo-0.17.0 lib/meibo/enrollment_set.rb
meibo-0.16.0 lib/meibo/enrollment_set.rb
meibo-0.15.0 lib/meibo/enrollment_set.rb
meibo-0.14.0 lib/meibo/enrollment_set.rb
meibo-0.13.0 lib/meibo/enrollment_set.rb