Class: OneRoster::Types::Class

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#to_h

Constructor Details

#initialize(attributes = {}) ⇒ Class

Returns a new instance of Class.



13
14
15
16
17
18
19
20
21
# File 'lib/types/class.rb', line 13

def initialize(attributes = {}, *)
  @uid        = attributes['sourcedId']
  @title      = capitalize(attributes['title'])
  @course_uid = attributes['course']['sourcedId']
  @status     = attributes['status']
  @period     = first_period(attributes) || period_from_code(attributes)
  @grades     = attributes['grades']
  @provider   = 'oneroster'
end

Instance Attribute Details

#course_uidObject (readonly)

Returns the value of attribute course_uid.



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

def course_uid
  @course_uid
end

#gradesObject (readonly)

Returns the value of attribute grades.



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

def grades
  @grades
end

#periodObject (readonly)

Returns the value of attribute period.



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

def period
  @period
end

#providerObject (readonly)

Returns the value of attribute provider.



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

def provider
  @provider
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

#uidObject (readonly)

Returns the value of attribute uid.



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

def uid
  @uid
end