Sha256: ea959ddbed597bfd069a999b5aa8e1a47d9f1142e63f8862f1ec2d7d7a832739

Contents?: true

Size: 861 Bytes

Versions: 15

Compression:

Stored size: 861 Bytes

Contents

# frozen_string_literal: true

require "securerandom"

module Meibo
  class Builder
    module ClassroomBuilder
      extend BaseBuilder

      def self.builder_attribute_names
        %i[builder course school terms]
      end

      def initialize(builder:, course:, school:, terms:, sourced_id: SecureRandom.uuid, **kw)
        super(
          sourced_id: sourced_id,
          course_sourced_id: course.sourced_id,
          school_sourced_id: school.sourced_id,
          term_sourced_ids: terms.map(&:sourced_id),
          **kw
        )
        @builder = builder
        @course = course
        @school = school
        @terms = terms
        builder.classes << self
      end

      def build_enrollment(**kw)
        builder.build_enrollment(
          classroom: self,
          school: school,
          **kw
        )
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
meibo-0.27.1 lib/meibo/builder/classroom_builder.rb
meibo-0.27.0 lib/meibo/builder/classroom_builder.rb
meibo-0.26.0 lib/meibo/builder/classroom_builder.rb
meibo-0.25.3 lib/meibo/builder/classroom_builder.rb
meibo-0.25.2 lib/meibo/builder/classroom_builder.rb
meibo-0.25.1 lib/meibo/builder/classroom_builder.rb
meibo-0.25.0 lib/meibo/builder/classroom_builder.rb
meibo-0.24.0 lib/meibo/builder/classroom_builder.rb
meibo-0.23.0 lib/meibo/builder/classroom_builder.rb
meibo-0.22.0 lib/meibo/builder/classroom_builder.rb
meibo-0.21.0 lib/meibo/builder/classroom_builder.rb
meibo-0.20.0 lib/meibo/builder/classroom_builder.rb
meibo-0.19.0 lib/meibo/builder/classroom_builder.rb
meibo-0.18.0 lib/meibo/builder/classroom_builder.rb
meibo-0.17.0 lib/meibo/builder/classroom_builder.rb