Method: Clever::Types::Section#initialize

Defined in:
lib/clever/types/section.rb

#initialize(attributes = {}) ⇒ Section

Returns a new instance of Section.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/clever/types/section.rb', line 19

def initialize(attributes = {}, *)
  @uid                 = attributes['id']
  @name                = attributes['name']
  @period              = attributes['period']
  @course              = attributes['course']
  @grades              = [presence(attributes['grade'])].compact
  @subjects            = [presence(attributes['subject'])].compact
  @students            = attributes['students']
  @teachers            = attributes['teachers']
  @term_id             = attributes['term_id']
  @primary_teacher_uid = attributes['teacher']
  @school_uid          = attributes['school']
  @provider            = 'clever'
end