Module: Meibo::Builder::CourseBuilder

Extended by:
BaseBuilder
Defined in:
lib/meibo/builder/course_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/course_builder.rb', line 10

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

Instance Method Details

#build_classroom(**kw) ⇒ Object



27
28
29
# File 'lib/meibo/builder/course_builder.rb', line 27

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

#initialize(builder:, organization:, sourced_id: SecureRandom.uuid, school_year: nil, **kw) ⇒ Object



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

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