Class: Canvas::Models::Enrollment
- Defined in:
- app/models/canvas/models/enrollment.rb
Instance Attribute Summary collapse
-
#associated_user_sis_id ⇒ Object
Returns the value of attribute associated_user_sis_id.
-
#course_sis_id ⇒ Object
Returns the value of attribute course_sis_id.
-
#role ⇒ Object
Returns the value of attribute role.
-
#section_sis_id ⇒ Object
Returns the value of attribute section_sis_id.
-
#status ⇒ Object
Returns the value of attribute status.
-
#user_sis_id ⇒ Object
Returns the value of attribute user_sis_id.
Instance Method Summary collapse
Methods inherited from BaseModel
Constructor Details
This class inherits a constructor from Canvas::Models::BaseModel
Instance Attribute Details
#associated_user_sis_id ⇒ Object
Returns the value of attribute associated_user_sis_id.
7 8 9 |
# File 'app/models/canvas/models/enrollment.rb', line 7 def associated_user_sis_id @associated_user_sis_id end |
#course_sis_id ⇒ Object
Returns the value of attribute course_sis_id.
7 8 9 |
# File 'app/models/canvas/models/enrollment.rb', line 7 def course_sis_id @course_sis_id end |
#role ⇒ Object
Returns the value of attribute role.
7 8 9 |
# File 'app/models/canvas/models/enrollment.rb', line 7 def role @role end |
#section_sis_id ⇒ Object
Returns the value of attribute section_sis_id.
7 8 9 |
# File 'app/models/canvas/models/enrollment.rb', line 7 def section_sis_id @section_sis_id end |
#status ⇒ Object
Returns the value of attribute status.
7 8 9 |
# File 'app/models/canvas/models/enrollment.rb', line 7 def status @status end |
#user_sis_id ⇒ Object
Returns the value of attribute user_sis_id.
7 8 9 |
# File 'app/models/canvas/models/enrollment.rb', line 7 def user_sis_id @user_sis_id end |
Instance Method Details
#after_initialize ⇒ Object
13 14 15 |
# File 'app/models/canvas/models/enrollment.rb', line 13 def after_initialize self.status ||= 'active' end |
#course_or_section ⇒ Object
9 10 11 |
# File 'app/models/canvas/models/enrollment.rb', line 9 def course_or_section errors.add(:id, 'An enrollment must have either a course_id or a section_id') unless @course_sis_id || @section_sis_id end |