Module: Meibo::Builder::ClassroomBuilder

Extended by:
BaseBuilder
Defined in:
lib/meibo/builder/classroom_builder.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BaseBuilder

create

Class Method Details

.builder_attribute_namesObject



10
11
12
# File 'lib/meibo/builder/classroom_builder.rb', line 10

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

Instance Method Details

#build_enrollment(**kw) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/meibo/builder/classroom_builder.rb', line 29

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

#initialize(builder:, course:, school:, terms:, sourced_id: SecureRandom.uuid, **kw) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/meibo/builder/classroom_builder.rb', line 14

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