Class: CanvasFactory::Section
- Inherits:
-
Object
- Object
- CanvasFactory::Section
- Defined in:
- lib/japanda/canvas_factory/section.rb
Instance Attribute Summary collapse
-
#course_id ⇒ Object
readonly
Returns the value of attribute course_id.
-
#end_at ⇒ Object
readonly
Returns the value of attribute end_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#integration_id ⇒ Object
readonly
Returns the value of attribute integration_id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#nonxlist_course_id ⇒ Object
readonly
Returns the value of attribute nonxlist_course_id.
-
#sis_course_id ⇒ Object
readonly
Returns the value of attribute sis_course_id.
-
#sis_import_id ⇒ Object
readonly
Returns the value of attribute sis_import_id.
-
#sis_section_id ⇒ Object
readonly
Returns the value of attribute sis_section_id.
-
#start_at ⇒ Object
readonly
Returns the value of attribute start_at.
Instance Method Summary collapse
- #create_section(course_id, section_config) ⇒ Object
-
#initialize(course_id, section_config = CanvasFactory::SectionConfig.new) ⇒ Section
constructor
A new instance of Section.
Constructor Details
#initialize(course_id, section_config = CanvasFactory::SectionConfig.new) ⇒ Section
Returns a new instance of Section.
7 8 9 |
# File 'lib/japanda/canvas_factory/section.rb', line 7 def initialize(course_id, section_config = CanvasFactory::SectionConfig.new) create_section course_id, section_config end |
Instance Attribute Details
#course_id ⇒ Object (readonly)
Returns the value of attribute course_id.
4 5 6 |
# File 'lib/japanda/canvas_factory/section.rb', line 4 def course_id @course_id end |
#end_at ⇒ Object (readonly)
Returns the value of attribute end_at.
4 5 6 |
# File 'lib/japanda/canvas_factory/section.rb', line 4 def end_at @end_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/japanda/canvas_factory/section.rb', line 4 def id @id end |
#integration_id ⇒ Object (readonly)
Returns the value of attribute integration_id.
4 5 6 |
# File 'lib/japanda/canvas_factory/section.rb', line 4 def integration_id @integration_id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/japanda/canvas_factory/section.rb', line 4 def name @name end |
#nonxlist_course_id ⇒ Object (readonly)
Returns the value of attribute nonxlist_course_id.
4 5 6 |
# File 'lib/japanda/canvas_factory/section.rb', line 4 def nonxlist_course_id @nonxlist_course_id end |
#sis_course_id ⇒ Object (readonly)
Returns the value of attribute sis_course_id.
4 5 6 |
# File 'lib/japanda/canvas_factory/section.rb', line 4 def sis_course_id @sis_course_id end |
#sis_import_id ⇒ Object (readonly)
Returns the value of attribute sis_import_id.
4 5 6 |
# File 'lib/japanda/canvas_factory/section.rb', line 4 def sis_import_id @sis_import_id end |
#sis_section_id ⇒ Object (readonly)
Returns the value of attribute sis_section_id.
4 5 6 |
# File 'lib/japanda/canvas_factory/section.rb', line 4 def sis_section_id @sis_section_id end |
#start_at ⇒ Object (readonly)
Returns the value of attribute start_at.
4 5 6 |
# File 'lib/japanda/canvas_factory/section.rb', line 4 def start_at @start_at end |
Instance Method Details
#create_section(course_id, section_config) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/japanda/canvas_factory/section.rb', line 11 def create_section(course_id, section_config) section_end_point = "#{CANVAS_API_V1}/courses/#{course_id}/sections" response = CanvasFactory.perform_post(section_end_point, section_config.request_body) @course_id = response['course_id'] @id = response['id'] @name = response['name'] @end_at = response['end_at'] @start_at = response['start_at'] @sis_section_id = response['sis_section_id'] @sis_course_id = response['sis_course_id'] @integration_id = response['integration_id'] @sis_import_id = response['sis_import_id'] @nonxlist_course_id = response['nonxlist_course_id'] end |