Sha256: 9ef3c3a95cb87280702d4458e95e1d4984ef3c1bce7abb17587051cf54a335bb

Contents?: true

Size: 791 Bytes

Versions: 15

Compression:

Stored size: 791 Bytes

Contents

# frozen_string_literal: true

require "securerandom"

module Meibo
  class Builder
    module CourseBuilder
      extend BaseBuilder

      def self.builder_attribute_names
        %i[builder school_year organization]
      end

      def initialize(builder:, organization:, sourced_id: SecureRandom.uuid, school_year: nil, **kw)
        super(
          sourced_id: sourced_id,
          school_year_sourced_id: school_year&.sourced_id,
          org_sourced_id: organization.sourced_id,
          **kw
        )
        @builder = builder
        @school_year = school_year
        @organization = organization
        builder.courses << self
      end

      def build_classroom(**kw)
        builder.build_classroom(course: self, school: organization, **kw)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

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