Class: OneRoster::Types::Class
Instance Attribute Summary collapse
-
#course_uid ⇒ Object
readonly
Returns the value of attribute course_uid.
-
#grades ⇒ Object
readonly
Returns the value of attribute grades.
-
#period ⇒ Object
readonly
Returns the value of attribute period.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
-
#subjects ⇒ Object
readonly
Returns the value of attribute subjects.
-
#term_id ⇒ Object
readonly
Returns the value of attribute term_id.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#uid ⇒ Object
readonly
Returns the value of attribute uid.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Class
constructor
A new instance of Class.
Methods inherited from Base
Constructor Details
#initialize(attributes = {}) ⇒ Class
Returns a new instance of Class.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/types/class.rb', line 15 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 = presence(attributes['grades']) || [] @subjects = presence(attributes['subjects']) || [] @term_id = attributes.dig('terms', 0, 'sourcedId') @provider = 'oneroster' end |
Instance Attribute Details
#course_uid ⇒ Object (readonly)
Returns the value of attribute course_uid.
6 7 8 |
# File 'lib/types/class.rb', line 6 def course_uid @course_uid end |
#grades ⇒ Object (readonly)
Returns the value of attribute grades.
6 7 8 |
# File 'lib/types/class.rb', line 6 def grades @grades end |
#period ⇒ Object (readonly)
Returns the value of attribute period.
6 7 8 |
# File 'lib/types/class.rb', line 6 def period @period end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
6 7 8 |
# File 'lib/types/class.rb', line 6 def provider @provider end |
#subjects ⇒ Object (readonly)
Returns the value of attribute subjects.
6 7 8 |
# File 'lib/types/class.rb', line 6 def subjects @subjects end |
#term_id ⇒ Object (readonly)
Returns the value of attribute term_id.
6 7 8 |
# File 'lib/types/class.rb', line 6 def term_id @term_id end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/types/class.rb', line 6 def title @title end |
#uid ⇒ Object (readonly)
Returns the value of attribute uid.
6 7 8 |
# File 'lib/types/class.rb', line 6 def uid @uid end |