Class: Clever::Types::Section

Inherits:
Base
  • Object
show all
Defined in:
lib/clever/types/section.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#blank?, #presence, #to_h

Constructor Details

#initialize(attributes = {}) ⇒ Section

Returns a new instance of Section.



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

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']
  @provider            = 'clever'
  @primary_teacher_uid = attributes['teacher']
end

Instance Attribute Details

#courseObject (readonly)

Returns the value of attribute course.



6
7
8
# File 'lib/clever/types/section.rb', line 6

def course
  @course
end

#gradesObject (readonly)

Returns the value of attribute grades.



6
7
8
# File 'lib/clever/types/section.rb', line 6

def grades
  @grades
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/clever/types/section.rb', line 6

def name
  @name
end

#periodObject (readonly)

Returns the value of attribute period.



6
7
8
# File 'lib/clever/types/section.rb', line 6

def period
  @period
end

#primary_teacher_uidObject (readonly)

Returns the value of attribute primary_teacher_uid.



6
7
8
# File 'lib/clever/types/section.rb', line 6

def primary_teacher_uid
  @primary_teacher_uid
end

#providerObject (readonly)

Returns the value of attribute provider.



6
7
8
# File 'lib/clever/types/section.rb', line 6

def provider
  @provider
end

#studentsObject (readonly)

Returns the value of attribute students.



6
7
8
# File 'lib/clever/types/section.rb', line 6

def students
  @students
end

#subjectsObject (readonly)

Returns the value of attribute subjects.



6
7
8
# File 'lib/clever/types/section.rb', line 6

def subjects
  @subjects
end

#teachersObject (readonly)

Returns the value of attribute teachers.



6
7
8
# File 'lib/clever/types/section.rb', line 6

def teachers
  @teachers
end

#term_idObject (readonly)

Returns the value of attribute term_id.



6
7
8
# File 'lib/clever/types/section.rb', line 6

def term_id
  @term_id
end

#uidObject (readonly)

Returns the value of attribute uid.



6
7
8
# File 'lib/clever/types/section.rb', line 6

def uid
  @uid
end