Class: CanvasFactory::Section
- Inherits:
-
Object
- Object
- CanvasFactory::Section
- Defined in:
- lib/japanda/canvas_factory/section.rb
Overview
canvas section class
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.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#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
-
#initialize(course_id, opts = {}, merge = true) ⇒ Section
constructor
A new instance of Section.
Constructor Details
#initialize(course_id, opts = {}, merge = true) ⇒ Section
Returns a new instance of Section.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/japanda/canvas_factory/section.rb', line 7 def initialize(course_id, opts = {}, merge = true) @course_id = course_id @request = { course_section: { name: "section-#{Time.now.to_i}", start_at: Time.now, end_at: Time.now + (30 * 24 * 60 * 60), restrict_enrollments_to_section_dates: false, # enable_sis_reactivation: false, # sis_section_id: nil } } @request = Mergie.deep_merge(@request, opts, merge) create_section self 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 |
#request ⇒ Object (readonly)
Returns the value of attribute request.
4 5 6 |
# File 'lib/japanda/canvas_factory/section.rb', line 4 def request @request end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/japanda/canvas_factory/section.rb', line 4 def response @response 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 |